Closed Bug 1041691 Opened 10 years ago Closed 10 years ago

Cleanup CheckPluginStopEvent, prevent possible leak of running plugin

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: johns, Assigned: johns)

Details

Attachments

(1 file)

While looking at the codepaths for bug 883134, I found yet-another-reentrance issue in this code-- we may clear mPendingCheckPluginStopEvent after calling StopPluginInstance in CheckPluginStopEvent::Run, but StopPluginInstance is re-entrant. This could lead to:

> StopPluginInstance->Script->Setup New Plugin->Script->DestroyContent->QueueCheckPluginStopEvent
(In reply to John Schoenick [:johns] from comment #1)
> Created attachment 8459728 [details] [diff] [review]
> Cleanup CheckPluginStopEvent, prevent possible leak of running plugin

Annnd the explanation I put in the commit message instead of the comment field by accident:

Bug 1041691 - Cleanup CheckPluginStopEvent, prevent possible leak of running plugin
So I don't think this is behind bug 883134, but it's more potential re-entrance insanity cleanup that can't hurt.

The actual bug fixed here is nulling mPendingCheckPluginStopEvent at the end of CheckPluginStopEvent::Run, after StopPluginInstance(), which may have re-entered, thus potentially blocking a valid plugin stop event which could be the last-chance stop of a plugin when content is destroyed.

This also stops calling UnloadObject() inside CheckPluginStopEvent, which just throws away extra state for no apparent reason, avoids queuing some unnecessary events, and cleans up the code a little.
Attachment #8459728 - Flags: review?(benjamin) → review+
Comment on attachment 8459728 [details] [diff] [review]
Cleanup CheckPluginStopEvent, prevent possible leak of running plugin

https://hg.mozilla.org/integration/mozilla-inbound/rev/445f556f7a98
Attachment #8459728 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/445f556f7a98
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
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: