diff options
| author | George Hazan <ghazan@miranda.im> | 2018-11-12 20:12:53 +0300 | 
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2018-11-12 20:12:53 +0300 | 
| commit | 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (patch) | |
| tree | 96b0db981b4f5054f24d484902b597ba7da1c1a5 /plugins/ConnectionNotify/src | |
| parent | 9b35784c5042984fbb60785f0a4a41a64af545f6 (diff) | |
end of ME_OPT_INITIALISE related zoo in another plugins
Diffstat (limited to 'plugins/ConnectionNotify/src')
| -rw-r--r-- | plugins/ConnectionNotify/src/ConnectionNotify.cpp | 29 | 
1 files changed, 8 insertions, 21 deletions
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index c18dad2c35..107ff78e04 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -2,15 +2,10 @@  CMPlugin	g_plugin;
 -//PLUGINLINK *pluginLink=NULL;
 -HANDLE hOptInit = nullptr;
  static HWND hTimerWnd = (HWND)nullptr;
  static UINT TID = (UINT)12021;
 -//HANDLE hHookModulesLoaded=NULL;
  HANDLE hCheckEvent = nullptr;
  HANDLE hCheckHook = nullptr;
 -HANDLE hHookModulesLoaded = nullptr;
 -HANDLE hHookPreShutdown = nullptr;
  HANDLE hConnectionCheckThread = nullptr;
  HANDLE hFilterOptionsThread = nullptr;
  HANDLE killCheckThreadEvent = nullptr;
 @@ -861,13 +856,9 @@ int CMPlugin::Load()  	g_plugin.addSound(PLUGINNAME_NEWSOUND, PLUGINNAMEW, LPGENW("New Connection Notification"));
 -	hOptInit = HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit);//register service to hook option call
 -	assert(hOptInit);
 -	
 -	hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, modulesloaded);//hook event that all plugins are loaded
 -	assert(hHookModulesLoaded);
 -	
 -	hHookPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, preshutdown);
 +	HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit); // register service to hook option call
 +	HookEvent(ME_SYSTEM_MODULESLOADED, modulesloaded); // hook event that all plugins are loaded
 +	HookEvent(ME_SYSTEM_PRESHUTDOWN, preshutdown);
  	return 0;
  }
 @@ -876,15 +867,11 @@ int CMPlugin::Load()  int CMPlugin::Unload()
  {
  	WaitForSingleObjectEx(hConnectionCheckThread, INFINITE, FALSE);
 -	if (hConnectionCheckThread)CloseHandle(hConnectionCheckThread);
 -	if (hCheckEvent)DestroyHookableEvent(hCheckEvent);
 -	if (hOptInit) UnhookEvent(hOptInit);
 -	if (hCheckHook)UnhookEvent(hCheckHook);
 -	if (hHookModulesLoaded)UnhookEvent(hHookModulesLoaded);
 -	if (hHookPreShutdown)UnhookEvent(hHookPreShutdown);
 -	if (killCheckThreadEvent)
 -		CloseHandle(killCheckThreadEvent);
 -	//if (hCurrentEditMutex) CloseHandle(hCurrentEditMutex);
 +
 +	if (hConnectionCheckThread) CloseHandle(hConnectionCheckThread);
 +	if (hCheckEvent) DestroyHookableEvent(hCheckEvent);
 +	if (hCheckHook) UnhookEvent(hCheckHook);
 +	if (killCheckThreadEvent) CloseHandle(killCheckThreadEvent);
  	if (hExceptionsMutex) CloseHandle(hExceptionsMutex);
  	#ifdef _DEBUG
  | 
