[Qt] Fixes premature plugin unload bug

https://bugs.webkit.org/show_bug.cgi?id=66628

Patch by Lindsay Mathieson <lindsay.mathieson@gmail.com> on 2011-08-21
Reviewed by Benjamin Poulain.

The QtPlatformPlugin was allocated on the stack, so its destructor is unloading the
plugin at the end of the scope. This patch moves the local creation of QtPlatformPlugin
to class member (TextCheckerClientQt::m_platformPlugin), preventing premature unloading
of plugin.

* WebCoreSupport/TextCheckerClientQt.cpp:
(WebCore::TextCheckerClientQt::loadSpellChecker):
* WebCoreSupport/TextCheckerClientQt.h:

git-svn-id: svn://svn.chromium.org/blink/trunk@93490 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 76c34c7d
2011-08-21 Lindsay Mathieson <lindsay.mathieson@gmail.com>
[Qt] Fixes premature plugin unload bug
https://bugs.webkit.org/show_bug.cgi?id=66628
Reviewed by Benjamin Poulain.
The QtPlatformPlugin was allocated on the stack, so its destructor is unloading the
plugin at the end of the scope. This patch moves the local creation of QtPlatformPlugin
to class member (TextCheckerClientQt::m_platformPlugin), preventing premature unloading
of plugin.
* WebCoreSupport/TextCheckerClientQt.cpp:
(WebCore::TextCheckerClientQt::loadSpellChecker):
* WebCoreSupport/TextCheckerClientQt.h:
2011-08-17 Adam Roben <aroben@apple.com> 2011-08-17 Adam Roben <aroben@apple.com>
Make WebCore keep track of the current device scale factor Make WebCore keep track of the current device scale factor
......
...@@ -152,8 +152,7 @@ bool TextCheckerClientQt::loadSpellChecker() ...@@ -152,8 +152,7 @@ bool TextCheckerClientQt::loadSpellChecker()
if (m_spellChecker) if (m_spellChecker)
return true; return true;
QtPlatformPlugin platformPlugin; if ((m_spellChecker = m_platformPlugin.createSpellChecker()))
if ((m_spellChecker = platformPlugin.createSpellChecker()))
return true; return true;
return false; return false;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#ifndef TextCheckerClientQt_h #ifndef TextCheckerClientQt_h
#define TextCheckerClientQt_h #define TextCheckerClientQt_h
#include "QtPlatformPlugin.h"
#include "TextCheckerClient.h" #include "TextCheckerClient.h"
#include "qwebkitplatformplugin.h" #include "qwebkitplatformplugin.h"
...@@ -58,6 +59,7 @@ private: ...@@ -58,6 +59,7 @@ private:
bool loadSpellChecker(); bool loadSpellChecker();
private: private:
QtPlatformPlugin m_platformPlugin;
OwnPtr<QWebSpellChecker> m_spellChecker; OwnPtr<QWebSpellChecker> m_spellChecker;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment