Merge pull request #35 from inmarket/master

Fix to destroying of gwin buttons
remotes/origin_old/ugfx_release_2.6
Tectu 2013-03-02 04:06:41 -08:00
commit bf86b741da
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: