Bug 16944 - Use of GST_PLUGIN_DEFINE_STATIC results in a module-level constructor
Summary: Use of GST_PLUGIN_DEFINE_STATIC results in a module-level constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL: http://bugzilla.gnome.org/show_bug.cg...
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2008-01-19 20:05 PST by Mark Rowe (bdash)
Modified: 2008-01-19 20:55 PST (History)
1 user (show)

See Also:


Attachments
Fix (1.76 KB, patch)
2008-01-19 20:31 PST, Alp Toker
mrowe: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 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.
Comment 1 Alp Toker 2008-01-19 20:31:20 PST
Created attachment 18559 [details]
Fix

GST_PLUGIN_DEFINE_STATIC isn't needed at all.
Comment 2 Mark Rowe (bdash) 2008-01-19 20:35:11 PST
Comment on attachment 18559 [details]
Fix

r=me
Comment 3 Alp Toker 2008-01-19 20:55:15 PST
Landed in r29675/r29676.