version 1.21 | | version 1.22 |
---|
| | |
*/ | | */ |
void AttrDestroy(Attr self) | | void AttrDestroy(Attr self) |
{ | | { |
Edit tmp; | | |
Attr tmp2; | | Attr tmp2; |
| | |
if (self->attr) | | if (self->attr) |
| | |
* here we find out to what part this window belongs to. | | * here we find out to what part this window belongs to. |
* it may be: | | * it may be: |
* - Attr of Look in App | | * - Attr of Look in App |
* - MapAttr in Edit | | |
* - Attr of other Attr (inventory) | | * - Attr of other Attr (inventory) |
*/ | | */ |
| | |
if (self == self->app->attr) | | if (self == self->app->attr) |
self->app->attr = NULL; | | self->app->attr = NULL; |
else { | | else { |
for (tmp = self->app->edit; tmp; tmp = tmp->next) | | |
if (self == tmp->mapattr) { | | |
tmp->mapattr = NULL; | | |
break; | | |
} | | |
if (!tmp) { | | |
for (tmp2 = self->app->attr; tmp2; tmp2 = tmp2->attr) | | for (tmp2 = self->app->attr; tmp2; tmp2 = tmp2->attr) |
if (self == tmp2->attr) { | | if (self == tmp2->attr) { |
tmp2->attr = NULL; | | tmp2->attr = NULL; |
| | |
debug0 ("Cannot find origin of Attr!!\n"); | | debug0 ("Cannot find origin of Attr!!\n"); |
#endif | | #endif |
} | | } |
} | | |
XtFree((char*)self); | | XtFree((char*)self); |
} | | } |
| | |