summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2016-06-29 17:03:46 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2016-06-30 11:12:14 -0400
commit9285a8522fbe1a4651c729a52de97dfff73dcf9b (patch)
treea51b07ed1ff4d4ba9d312d1f5f2fb4f41d69c4ca
parent78bb07e6b80e4c5791669389587ec78eaaec6a3e (diff)
downloadclutter-9285a8522fbe1a4651c729a52de97dfff73dcf9b.tar.gz
Don't create the Cogl GLib source multiple times
Since the check for backend->cogl_context was accidentally moved to clutter_backend_do_real_create_context, the Glib source that is created at the end of clutter_backend_do_create_context() is created and added each time create_context() is called, though create_context() is supposed to be idempotent. https://bugzilla.gnome.org/show_bug.cgi?id=768243
-rw-r--r--clutter/clutter-backend.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index bce4e9138..d150e7c89 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -252,9 +252,6 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
CoglSwapChain *swap_chain;
GError *internal_error;
- if (backend->cogl_context != NULL)
- return TRUE;
-
klass = CLUTTER_BACKEND_GET_CLASS (backend);
swap_chain = NULL;
@@ -383,6 +380,9 @@ clutter_backend_real_create_context (ClutterBackend *backend,
gboolean allow_any;
int i;
+ if (backend->cogl_context != NULL)
+ return TRUE;
+
if (allowed_drivers == NULL)
allowed_drivers = CLUTTER_DRIVERS;