commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [commons-daemon] markt-asf commented on a change in pull request #32: DAEMON-336 - If lCallbacks is empty don't call the fnCallbacks to avoid an ACCESS_VIOLATION
Date Tue, 31 Aug 2021 15:27:05 GMT

markt-asf commented on a change in pull request #32:
URL: https://github.com/apache/commons-daemon/pull/32#discussion_r699116202



##########
File path: src/native/windows/src/handles.c
##########
@@ -496,13 +496,15 @@ apxCloseHandle(APXHANDLE hObject)
 
     if (IS_INVALID_HANDLE(hObject) || hObject->dwType == APXHANDLE_TYPE_INVALID)
         return FALSE;
-    /* Call the user callback first */
-    (*hObject->fnCallback)(hObject, WM_CLOSE, 0, 0);
-    /* Now go through the callback chain */
-    TAILQ_FOREACH(lpCall, &hObject->lCallbacks, queue) {
+    if (!TAILQ_EMPTY(&hObject->lCallbacks)) {
+        /* Call the user callback first */
+        (*hObject->fnCallback)(hObject, WM_CLOSE, 0, 0);

Review comment:
       Why is this inside the test of `lCallbacks`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message