Fix to allow destroying of gwin buttons

ugfx_release_2.6
Andrew Hannam 2013-03-02 22:03:40 +10:00
parent 6ee8b005ae
commit 57435fb4c2
2 changed files with 743 additions and 741 deletions

View File

@ -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) {

View File

@ -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: