summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/app.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/app.c b/src/common/app.c
index 3890a1d..5350f85 100644
--- a/src/common/app.c
+++ b/src/common/app.c
@@ -514,13 +514,14 @@ int yasl_run(const struct yasl_app_desc *desc)
desc->quit(desc->userdata, d);
}
- d->app_runner = NULL;
+ /* Destroy any surfaces that were not explicitly destroyed by the application */
while (runner.surfaces) {
- struct app_surface *next = runner.surfaces->next;
- free(runner.surfaces);
- runner.surfaces = next;
+ struct yasl_surface *s = runner.surfaces->surface;
+ yasl_surface_destroy(s);
}
+ d->app_runner = NULL;
+
pthread_mutex_lock(&runner.user_event_mutex);
struct user_event_node *node = runner.user_event_head;
while (node) {