don't free the XIC if it wasn't created. this appears to cause a crash
authorDana Jansens <danakj@orodu.net>
Thu, 4 Nov 2010 14:12:42 +0000 (10:12 -0400)
committerDana Jansens <danakj@orodu.net>
Mon, 24 Jan 2011 19:19:23 +0000 (14:19 -0500)
obt/keyboard.c

index db327a6..8bfdd39 100644 (file)
@@ -439,7 +439,8 @@ void obt_keyboard_context_unref(ObtIC *ic)
 {
     if (--ic->ref < 1) {
         xic_all = g_slist_remove(xic_all, ic);
 {
     if (--ic->ref < 1) {
         xic_all = g_slist_remove(xic_all, ic);
-        XDestroyIC(ic->xic);
+        if (ic->xic)
+            XDestroyIC(ic->xic);
         g_slice_free(ObtIC, ic);
     }
 }
         g_slice_free(ObtIC, ic);
     }
 }