From 4f688b57e4f370bf37117cccb0c2fba115c9a698 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 23 Apr 2018 17:17:43 +0300 Subject: AVS not to free memory allocated outside --- plugins/AVS/src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'plugins/AVS/src') diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 58edd6b794..23bcbd79c4 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -170,12 +170,15 @@ static int OnAccChanged(WPARAM wParam, LPARAM lParam) break; case PRAC_REMOVED: + // little perversion not to call the object's destructor + protoPicCacheEntry *tmp = (protoPicCacheEntry *)_alloca(sizeof(protoPicCacheEntry)); + tmp->cacheType = PCE_TYPE_ACCOUNT; + tmp->szProtoname = pa->szModuleName; + int idx; - protoPicCacheEntry tmp(PCE_TYPE_ACCOUNT); - tmp.szProtoname = pa->szModuleName; - if ((idx = g_ProtoPictures.getIndex(&tmp)) != -1) + if ((idx = g_ProtoPictures.getIndex(tmp)) != -1) g_ProtoPictures.remove(idx); - if ((idx = g_MyAvatars.getIndex(&tmp)) != -1) + if ((idx = g_MyAvatars.getIndex(tmp)) != -1) g_MyAvatars.remove(idx); break; } -- cgit v1.2.3