Closed Bug 412186 Opened 17 years ago Closed 17 years ago

Last widget close should not cause XPCOM shutdown.

Categories

(Core Graveyard :: Embedding: GTK Widget, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: romaxa, Assigned: romaxa)

Details

Attachments

(1 file)

Closing of the last gtk widget will shutdown XPCOM: http://mxr.mozilla.org/seamonkey/source/embedding/browser/gtk/src/EmbedPrivate.cpp#202 I guess it should be possible to close last widget without terminate XRE Embedding, and allow terminate XRE by gtk_moz_embed_pop_startup call.
Attached patch Proposed fixSplinter Review
Attachment #297340 - Flags: review?(mpgritti)
romaxa, please remember to check the "take bug" checkbox when attaching a patch for a bug so that the bug gets reassigned to you. Thanks!
Assignee: nobody → romaxa
Comment on attachment 297340 [details] [diff] [review] Proposed fix tabs: + if (sWidgetCount > 0 || sXpcomStarted) + return; this pretty much neuters EmbedPrivate::PushStartup EmbedPrivate::PopStartup I don't think that's such a good thing. It sounds like the embedder here should call gtk_moz_embed_push_startup/gtk_moz_embed_pop_startup before initializing anything else. The one extra push/pop pair before poking EmbedPrivate should trigger the more proper behavior without breaking anyone else.
Attachment #297340 - Flags: superreview?(roc)
Attachment #297340 - Flags: review?(benjamin)
Comment on attachment 297340 [details] [diff] [review] Proposed fix with that, i'm going to mark my own personal r- and suggest this bug is invalid. however any new module owners are free to clear my review and do whatever they please.
Attachment #297340 - Flags: review-
I just want to works next chain of calls: push_startup gtk_moz_embed_new() destroy(GtkMozEmbedWidget) gtk_moz_embed_new() destroy(GtkMozEmbedWidget) pop_startup(); exit();
Comment on attachment 297340 [details] [diff] [review] Proposed fix I agree this is incorrect. If you don't want to shut down when the last widget closes you should explicitly push_startup before doing anything else.
Attachment #297340 - Flags: review?(mpgritti)
Attachment #297340 - Flags: review?(benjamin)
Attachment #297340 - Flags: review-
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Or perhaps I don't understand... romaxa are you saying that your sequence doesn't work? If so, can you explain why not? It looks like it should work.
> If so, can you explain why not? It looks like it should work. I'm not sure where is the real problem, but after second XPCOM restart and attempt to create new GtkMozEmbed widget it crashes... I will try to locate problem (probably some static variables in XPCOM or in EmbedPrivate) and create new bug against proper component.
No, no, I mean, we should be starting XPCOM once and shutting it down once: push_startup -- start XPCOM here gtk_moz_embed_new() destroy(GtkMozEmbedWidget) gtk_moz_embed_new() destroy(GtkMozEmbedWidget) pop_startup(); -- shutdown XPCOM here
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: