Bug 1386915 - Assert when nsLookAndFeel calls GTK off main thread. r=bholley, a=lizzard
authorManish Goregaokar <manishearth@gmail.com>
Thu, 03 Aug 2017 13:13:22 -0700
changeset 423470 90616c75a7842da1e02a4efd4f5f558b567e8a70
parent 423469 dfdabd1604744ac836b74b495414e9bab6f1f736
child 423471 ed7048ecb1f59be020b707fdc7ee953bfc059387
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, lizzard
bugs1386915
milestone56.0
Bug 1386915 - Assert when nsLookAndFeel calls GTK off main thread. r=bholley, a=lizzard MozReview-Commit-ID: 9H9dE02bZel
widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -1069,16 +1069,19 @@ nsLookAndFeel::EnsureInit()
 {
     GdkColor colorValue;
     GdkColor *colorValuePtr;
 
     if (mInitialized)
         return;
     mInitialized = true;
 
+    // gtk does non threadsafe refcounting
+    MOZ_ASSERT(NS_IsMainThread());
+
 #if (MOZ_WIDGET_GTK == 2)
     NS_ASSERTION(!mStyle, "already initialized");
     // GtkInvisibles come with a refcount that is not floating
     // (since their initialization code calls g_object_ref_sink) and
     // their destroy code releases that reference (which means they
     // have to be explicitly destroyed, since calling unref enough
     // to cause destruction would lead to *another* unref).
     // However, this combination means that it's actually still ok