Mercurial > dwindows
comparison os2/dw.c @ 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 | da058319f717 |
children | d17e3fb76bde |
comparison
equal
deleted
inserted
replaced
2614:dbcd9416e9c9 | 2615:ac51cbdcfbe5 |
---|---|
6053 * menu: Handle of a menu. | 6053 * menu: Handle of a menu. |
6054 */ | 6054 */ |
6055 void API dw_menu_destroy(HMENUI *menu) | 6055 void API dw_menu_destroy(HMENUI *menu) |
6056 { | 6056 { |
6057 if(menu) | 6057 if(menu) |
6058 { | |
6058 WinDestroyWindow(*menu); | 6059 WinDestroyWindow(*menu); |
6060 *menu = 0; | |
6061 } | |
6059 } | 6062 } |
6060 | 6063 |
6061 /* Internal function to make sure menu ID isn't in use */ | 6064 /* Internal function to make sure menu ID isn't in use */ |
6062 int _menuid_allocated(int id) | 6065 int _menuid_allocated(int id) |
6063 { | 6066 { |