From 78c57745d5c7497dbc9cc9e573df1f1d318f37ef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Sep 2016 09:49:29 +0000 Subject: crash fix in Skype custom icon handler git-svn-id: http://svn.miranda-ng.org/main/trunk@17299 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/db_events.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp index bc3fb4d470..0a2b6a6431 100644 --- a/src/mir_app/src/db_events.cpp +++ b/src/mir_app/src/db_events.cpp @@ -63,23 +63,22 @@ MIR_APP_DLL(int) DbEvent_RegisterType(DBEVENTTYPEDESCR *et) p->module = mir_strdup(et->module); p->eventType = et->eventType; p->descr = mir_strdup(et->descr); - if (et->textService) - p->textService = mir_strdup(et->textService); - if (et->iconService) - p->iconService = mir_strdup(et->iconService); p->eventIcon = et->eventIcon; p->flags = et->flags; + char szServiceName[100]; if (!p->textService) { - char szServiceName[100]; mir_snprintf(szServiceName, "%s/GetEventText%d", p->module, p->eventType); p->textService = mir_strdup(szServiceName); } + else p->textService = mir_strdup(et->textService); + if (!p->iconService) { - char szServiceName[100]; mir_snprintf(szServiceName, "%s/GetEventIcon%d", p->module, p->eventType); p->iconService = mir_strdup(szServiceName); } + else p->iconService = mir_strdup(et->iconService); + eventTypes.insert(p); return 0; } @@ -223,7 +222,7 @@ MIR_APP_DLL(HICON) DbEvent_GetIcon(DBEVENTINFO *dbei, int flags) { DBEVENTTYPEDESCR *et = DbEvent_GetType(dbei->szModule, dbei->eventType); if (et && ServiceExists(et->iconService)) { - HICON icon = (HICON)CallService(et->iconService, (WPARAM)dbei, flags); + HICON icon = (HICON)CallService(et->iconService, flags, (LPARAM)dbei); if (icon) return icon; } -- cgit v1.2.3