Index: src/plugin/PluginTabBase.cpp |
=================================================================== |
--- a/src/plugin/PluginTabBase.cpp |
+++ b/src/plugin/PluginTabBase.cpp |
@@ -25,13 +25,11 @@ |
#include "../shared/Utils.h" |
#include <Mshtmhst.h> |
-CPluginTabBase::CPluginTabBase(CPluginClass* plugin) |
- : m_plugin(plugin) |
- , m_isActivated(false) |
+CPluginTabBase::CPluginTabBase() |
+ : m_isActivated(false) |
, m_continueThreadRunning(true) |
{ |
- m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter()); |
- m_filter->hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL); |
+ m_filter.hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL); |
CPluginClient* client = CPluginClient::GetInstance(); |
if (AdblockPlus::IE::InstalledMajorVersion() < 10) |
@@ -76,12 +74,12 @@ |
namespace |
{ |
// Entry Point |
- void FilterLoader(CPluginTabBase* tabBase) |
+ void FilterLoader(CPluginFilter* filter, const std::wstring& domain) |
{ |
try |
{ |
- tabBase->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelectors(tabBase->GetDocumentDomain())); |
- SetEvent(tabBase->m_filter->hideFiltersLoadedEvent); |
+ filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelectors(domain)); |
+ SetEvent(filter->hideFiltersLoadedEvent); |
} |
catch (...) |
{ |
@@ -95,10 +93,10 @@ |
SetDocumentUrl(url); |
ClearFrameCache(GetDocumentDomain()); |
std::wstring domainString = GetDocumentDomain(); |
- ResetEvent(m_filter->hideFiltersLoadedEvent); |
+ ResetEvent(m_filter.hideFiltersLoadedEvent); |
try |
{ |
- std::thread filterLoaderThread(&FilterLoader, this); |
+ std::thread filterLoaderThread(&FilterLoader, &m_filter, GetDocumentDomain()); |
filterLoaderThread.detach(); // TODO: but actually we should wait for the thread in the dtr. |
} |
catch (const std::system_error& ex) |