Bug 16944

Summary: Use of GST_PLUGIN_DEFINE_STATIC results in a module-level constructor
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alp
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
URL: http://bugzilla.gnome.org/show_bug.cgi?id=510547
Attachments:
Description Flags
Fix mrowe: review+

Mark Rowe (bdash)
Reported 2008-01-19 20:05:05 PST
As mentioned at <http://bugzilla.gnome.org/show_bug.cgi?id=510547>, VideoSinkGStreamer.cpp's use of GST_PLUGIN_DEFINE_STATIC results in a global constructor being created that calls g_thread_init() before Epiphany's main() is entered. This results in a nasty diagnostic being emitted when Epiphany goes on to call g_thread_init() itself. In general we need to avoid these sorts of constructors as they add to startup time of applications linking against WebKit, and introduce memory footprint which may not be used until much later. In this instance the side-effect is more severe, but we should keep an eye out for other subtler instances of this problem.
Attachments
Fix (1.76 KB, patch)
2008-01-19 20:31 PST, Alp Toker
mrowe: review+
Alp Toker
Comment 1 2008-01-19 20:31:20 PST
Created attachment 18559 [details] Fix GST_PLUGIN_DEFINE_STATIC isn't needed at all.
Mark Rowe (bdash)
Comment 2 2008-01-19 20:35:11 PST
Comment on attachment 18559 [details] Fix r=me
Alp Toker
Comment 3 2008-01-19 20:55:15 PST
Landed in r29675/r29676.
Note You need to log in before you can comment on or make changes to this bug.