Comment 8 for bug 724587

Revision history for this message
In , Peter (peter-redhat-bugs) wrote :

Created attachment 482872
Delay calls to NPP_Destroy when the plugin instance is on the stack.

Delay calls to NPP_Destroy when the plugin instance is on the stack

Otherwise, from the plugin's perspective, NPN_InvalidateRect results in
the plugin instance exploding. One can hardly blame Adobe that Flash
crashes in this situation.

Unfortunately, because we attempt to speak synchronous NPAPI on both
ends and there's the additional SYNC mechanism forcing a particular
order, we cannot reorder the calls. As a result, when NPP_Destroy must
be delayed, we lie to the browser and actually destroy the plugin later.
This means, however, that any NPSavedData provided by the plugin is
ignored. In this case, a warning is emitted.

We do a slightly more conservative check and delay whenever we have any
invoke on the call stack, be it this instance or any other. This is
better than checking the refcount because any NPObjectInfo will hold a
reference.