Mercurial > dwindows
comparison ios/dw.m @ 2615:ac51cbdcfbe5
dw_menu_destroy() should zero out the handle passed, GTK does this already.
Also check the pointer is valid before using it in Mac and iOS.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 23 Jul 2021 15:28:42 +0000 |
parents | 4628c8c34125 |
children | a256caa5034c |
comparison
equal
deleted
inserted
replaced
2614:dbcd9416e9c9 | 2615:ac51cbdcfbe5 |
---|---|
7639 * Parameters: | 7639 * Parameters: |
7640 * menu: Handle of a menu. | 7640 * menu: Handle of a menu. |
7641 */ | 7641 */ |
7642 void API dw_menu_destroy(HMENUI *menu) | 7642 void API dw_menu_destroy(HMENUI *menu) |
7643 { | 7643 { |
7644 DWMenu *thismenu = *menu; | 7644 if(menu) |
7645 DW_LOCAL_POOL_IN; | 7645 { |
7646 [thismenu release]; | 7646 DWMenu *thismenu = *menu; |
7647 DW_LOCAL_POOL_OUT; | 7647 DW_LOCAL_POOL_IN; |
7648 [thismenu release]; | |
7649 DW_LOCAL_POOL_OUT; | |
7650 *menu = NULL; | |
7651 } | |
7648 } | 7652 } |
7649 | 7653 |
7650 /* | 7654 /* |
7651 * Pops up a context menu at given x and y coordinates. | 7655 * Pops up a context menu at given x and y coordinates. |
7652 * Parameters: | 7656 * Parameters: |