Hi,

Finally I understand the problem. It's not that bad as I thought initially,
but I think it must be fixed anyway.
The problem comes from combobox.
Suppose we have dialog box with single combobox (not CBS_SIMPLE). Close
dialog, so DestroyWindow for dialog is called. DestroyWindow unlinks
dialog's wndPtr and calls WIN_DestroyWindow. Last one kills all children.
Recieving WM_NCDESTROY message, combobox destroys ComboLBox. When
DestroyWindow for ComboLBox comes to UnlinkWindow dialog's wndPtr is already
wired off, but it still keeps pointer to the next window - ComboLBox which
is about to be deleted.

I checked under Windows and it looks like window is unlinked right before it
recieves WM_NCDESTROY. At least GetWindow(GW_HWNDNEXT | HWNDPREV) at
WM_NCDESTROY returns 0 (though you still can get parent).

Can somebody verify this patch?

Index: win.c
===================================================================
RCS file: /home/cvs/r/corelwine/windows/win.c,v
retrieving revision 1.92
diff -u -r1.18 win.c
--- win.c 2000/06/08 01:01:09 1.92
+++ win.c 2000/06/13 19:46:31
@@ -462,6 +462,10 @@
  wndPtr->hrgnUpdate = 0;
     }

+    pWnd = WIN_LockWndPtr(wndPtr->next);
+    if(wndPtr->parent) WIN_UnlinkWindow(wndPtr->hwndSelf);
+    wndPtr->next = 0;
+
     /*
      * Send the WM_NCDESTROY to the window being destroyed.
      */
@@ -522,8 +526,6 @@
     wndPtr->class->cWindows--;
     wndPtr->class = NULL;

-    WIN_UpdateWndPtr(&pWnd,wndPtr->next);
-
     wndPtr->pDriver->pFinalize(wndPtr);

     return pWnd;
@@ -1442,10 +1444,6 @@
         retvalue = TRUE;
         goto end;
     }
-
-      /* Unlink now so we won't bother with the children later on */
-
-    if( wndPtr->parent ) WIN_UnlinkWindow(hwnd);

       /* Destroy the window storage */



--
Serge Ivanov
(613) 728-0826 x5368
[EMAIL PROTECTED]


-- 
The address in the headers is not the poster's real email address.  Do not send
private mail to the poster using your mailer's "reply" feature.  CC's of mail 
to mailing lists are OK.  Problem reports to "[EMAIL PROTECTED]".  
The poster's email address is "[EMAIL PROTECTED]".

Reply via email to