hust-marx / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

~PluginCore() is called with m_host==0 (Crashed IE) #142

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In javascript, add this

 try {
            // IE
            o = new ActiveXObject("XXXX.XXX");
        } catch (e) {
            // Others
            // refresh the list of plugins manually
            navigator.plugins.refresh();
            var type = "application/x-XXXXXX";
            var mimeTypes = navigator.mimeTypes;
            o = (mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin);
        }

This is a very common way to test if a given plugin is installed. 

2. Open IE, it will crash.

What version of FireBreath are you using? On what operating system and
browsers?
From git main branch. IE8

Please provide any additional information below.

I have debugged into the plugin, 

PluginCore::~PluginCore()
{
    // Tell the host that the plugin is shutting down
added--->if(m_host)
        m_host->shutdown();
    // This class is only destroyed on the main UI thread,
    // so there is no need for mutexes here
    --PluginCore::ActivePluginCount;
}

I found that m_host is used when it is 0. So, I just added if(m_host), and it 
is fixed. Please fix the main branch. 

Thanks.
Xizhi,
----------
This problem does not exist in previous version.

Original issue reported on code.google.com by xizhi...@gmail.com on 9 Feb 2011 at 8:19

GoogleCodeExporter commented 9 years ago
adding if(m_host) only fixes the crash, not the functionality.  Creating a 
plugin instance with ActiveXObject is now supported -- you'll never get a 
window -- in the latest 1.4 branch.

Original comment by richarda...@gmail.com on 12 Feb 2011 at 2:40