fix double free
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@772 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
68322187ff
commit
57dd0fdcf6
1 changed files with 7 additions and 1 deletions
|
|
@ -237,7 +237,13 @@ static void MwFreeWidget(MwWidget handle) {
|
|||
|
||||
void MwDestroyWidget(MwWidget handle) {
|
||||
if(handle->parent != NULL) {
|
||||
arrput(handle->parent->destroy_queue, handle);
|
||||
int i;
|
||||
for(i = 0; i < arrlen(handle->parent->destroy_queue); i++){
|
||||
if(handle->parent->destroy_queue[i] == handle) break;
|
||||
}
|
||||
if(i == arrlen(handle->parent->destroy_queue)){
|
||||
arrput(handle->parent->destroy_queue, handle);
|
||||
}
|
||||
}
|
||||
handle->destroyed = 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue