From: <kr_...@us...> - 2004-05-25 20:41:03
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22085/src/cbits/Win32 Modified Files: Action.c ActionsMap.c Frame.c Menu.c Log Message: Proper destroying of action handles Index: Action.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Action.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Action.c 16 May 2004 07:59:02 -0000 1.4 --- Action.c 25 May 2004 20:40:40 -0000 1.5 *************** *** 259,262 **** --- 259,299 ---- { FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + + while (action->toolProxies) + osDestroyToolItem(action->toolProxies); + + while (action->menuProxies) + osDestroyMenu(action->menuProxies); + + handleActionDestroy(action); + deleteActionHandle(pFrameData->pActionsMap, action); } + + void osDestroyAllActions() + { + FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + + for (;;) + { + int i; + ActionHandle action; + + for (i = 0; i < HASH_TABLE_SIZE; i++) + { + action = pFrameData->pActionsMap->HashTable[i]; + if (action) + break; + } + + if (!action) + break; + + + while (action) + { + osDestroyAction(action); + action = pFrameData->pActionsMap->HashTable[i]; + } + } + } Index: ActionsMap.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ActionsMap.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ActionsMap.c 14 May 2004 23:01:39 -0000 1.1 --- ActionsMap.c 25 May 2004 20:40:40 -0000 1.2 *************** *** 107,112 **** ActionHandle child, *prev; - handleActionDestroy(action); - nHash = (action->id >> 4) % HASH_TABLE_SIZE; prev = &(pMap->HashTable[nHash]); --- 107,110 ---- Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Frame.c 16 May 2004 07:55:08 -0000 1.29 --- Frame.c 25 May 2004 20:40:40 -0000 1.30 *************** *** 139,146 **** return 0; case WM_DESTROY: ! handleProcessDestroy(); ! free(pData->lpszAppName); ! free(pData->lpszAppVersion); ! deleteActionsMap(pData->pActionsMap); // clear StatusBar context stack --- 139,143 ---- return 0; case WM_DESTROY: ! osDestroyAllActions(); // clear StatusBar context stack *************** *** 169,172 **** --- 166,175 ---- pData->last_indicator = NULL; + handleProcessDestroy(); + + free(pData->lpszAppName); + free(pData->lpszAppVersion); + deleteActionsMap(pData->pActionsMap); + free(pData); PostQuitMessage(0); Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Menu.c 14 May 2004 23:01:39 -0000 1.20 --- Menu.c 25 May 2004 20:40:41 -0000 1.21 *************** *** 142,145 **** --- 142,150 ---- FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + while (handle->children) + osDestroyMenu(handle->children); + + handleMenuDestroy(handle); + if (handle->type != MENU_POPUP) { |