Fix to allow destroying of gwin buttons
This commit is contained in:
parent
6ee8b005ae
commit
57435fb4c2
2 changed files with 743 additions and 741 deletions
|
@ -108,7 +108,7 @@ bool_t geventAttachSource(GListener *pl, GSourceHandle gsh, unsigned flags) {
|
|||
}
|
||||
|
||||
void geventDetachSource(GListener *pl, GSourceHandle gsh) {
|
||||
if (pl && gsh) {
|
||||
if (pl) {
|
||||
chMtxLock(&geventMutex);
|
||||
deleteAssignments(pl, gsh);
|
||||
if (!gsh && chSemGetCounterI(&pl->waitqueue) < 0) {
|
||||
|
|
|
@ -108,6 +108,8 @@ void gwinDestroyWindow(GHandle gh) {
|
|||
gh->flags &= ~GBTN_FLG_ALLOCTXT; // To be sure, to be sure
|
||||
chHeapFree((void *)((GButtonObject *)gh)->txt);
|
||||
}
|
||||
geventDetachSource(&((GButtonObject *)gh)->listener, 0);
|
||||
geventDetachSourceListeners((GSourceHandle *)gh);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue