summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-10-31 14:32:22 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-02-11 19:23:32 +0000
commita0e41a46a3b9b1f94c0449adeda18ff46fdf6a66 (patch)
tree55c2ce4e2fb3dbc613c8b9ecab9e80316f4c8606 /content
parent90f65814c68b898117ea5cbccfd3221c72074c84 (diff)
downloadnetsurf-a0e41a46a3b9b1f94c0449adeda18ff46fdf6a66.tar.gz
netsurf-a0e41a46a3b9b1f94c0449adeda18ff46fdf6a66.tar.bz2
Stop GIF animations when they are no longer in use, instead of waiting until they are destroyed.
Diffstat (limited to 'content')
-rw-r--r--content/content.c7
-rw-r--r--content/content_protected.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c
index be39b15a6..3d06f8e07 100644
--- a/content/content.c
+++ b/content/content.c
@@ -670,6 +670,9 @@ bool content_add_user(struct content *c,
user->next = c->user_list->next;
c->user_list->next = user;
+ if (c->handler->add_user != NULL)
+ c->handler->add_user(c);
+
return true;
}
@@ -699,6 +702,10 @@ void content_remove_user(struct content *c,
assert(0);
return;
}
+
+ if (c->handler->remove_user != NULL)
+ c->handler->remove_user(c);
+
next = user->next;
user->next = next->next;
free(next);
diff --git a/content/content_protected.h b/content/content_protected.h
index 7311da604..e5ff1cae2 100644
--- a/content/content_protected.h
+++ b/content/content_protected.h
@@ -82,6 +82,8 @@ struct content_handler {
bool (*matches_quirks)(const struct content *c, bool quirks);
const char *(*get_encoding)(const struct content *c, enum content_encoding_type op);
content_type (*type)(void);
+ void (*add_user)(struct content *c);
+ void (*remove_user)(struct content *c);
/** handler dependant content sensitive internal data interface. */
void * (*get_internal)(const struct content *c, void *context);