Closed Bug 469024 Opened 16 years ago Closed 3 years ago

Plugin not shutting down correctly when used in a modal dialog

Categories

(Core Graveyard :: Plug-ins, defect, P3)

All
macOS
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: twhitema, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/8.04 (hardy) Firefox/3.0.4
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2

I'm noticing that a plugin is not getting correctly cleaned up after being opened in a modal window. The plugin window is being instantiated using a menu under the Firefox Tools menu, which uses JavaScript to open the desired window.

Case 1: The plugin does not receive the "NPP_Destroy" event for:

  window.openDialog('chrome://debugpluginevents/content/debugevents.xul',
                    '_blank', 'chrome,modal,titlebar,resizable');

Case 2: It does get the "NPP_Destroy" event on closing when not using the modal argument:

  window.openDialog('chrome://debugpluginevents/content/debugevents.xul',
                    '_blank', 'chrome,titlebar,resizable');

Case 3: What is really strange, is that if I use a setTimeout with the modal dialog (case 1), this cleans up the plugin correctly when the window is closed!?

  window.setTimeout(window.openDialog, 1000,
                    'chrome://debugpluginevents/content/debugevents.xul',
                    '_blank', 'chrome,modal,titlebar,resizable');


Note: I have seen this problem on both Mozilla 1.9 (Firefox 3.0, Komodo 5.0) and Mozilla 1.9.1 (Firefox 3.1).


Reproducible: Always

Steps to Reproduce:
I'll post the repro using an extension (in an attachment) in the next post.
The attachment is a Firefox extension that can be installed into Firefox 3.0 or 3.1, which provides a number of commands under the "Tools" menu.

This extension requires that the debug plugin (bug 441880) to be installed.

To reproduce the problem:
1) launch Firefox from the command line (so you easily see the log output)
2) use the "Tools->Debug Plugin" to launch the plugin window
3) close the plugin window - you'll see a "NPP_Destroy" event after closing
4) use the "Tools->Debug Plugin (modal)" to launch the plugin window modally
5) close the plugin window - there are no "NPP_Destroy" events
I'm working on Komodo (Mozilla 1.9.0) and a similar bug is affecting the creation/deletion of editor plugin (Scintilla) within Komodo, resulting in a lot of unfinalized plugin elements in memory. Hopefully the following may provide some additional insight into what could be occurring with this plugin problem:

This plugin problem causes Komodo to start consuming a lot of CPU after the user has closed a number of the editor tabs (the editor tab in Komodo is a XBL binding around the Scintilla plugin).

I notice that if I use a setTimeout when the Komodo editor tab is initially created, then it will always be correctly cleaned up after closing the tab, but if the editor tab was created as part of an event handler (like a double click on a XUL element, or menu oncommand handler) then the plugin is never destroyed (even after closing the Komodo Window that created the plugin).

I also notice that if the editor xbl binding does not try to access the plugin directly after loading into the DOM (after performing createElement, appendAppend), the the plugin will also be correctly destroyed when it's closed (removed from the DOM).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: wanted1.9.2+
Priority: -- → P2
Hardware: x86 → All
Version: unspecified → Trunk
Priority: P2 → P3
Resolving as wont fix, plugin support deprecated in Firefox 85.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: