aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wx/c_src')
-rw-r--r--lib/wx/c_src/wxe_impl.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index 95755978f1..70d4c4b29e 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -588,7 +588,7 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) {
} else {
delete_object(ptr, refd);
}
- if(type == 0 || type > 3) {
+ if(type == 0 || type > 2) {
// Delete refs for leaks and non overridden allocs
delete refd;
ptr2ref.erase(it);
@@ -602,13 +602,13 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) {
}
}
}
- // Assert ?
-// for(ptrMap::iterator it = ptr2ref.begin(); it != ptr2ref.end(); it++) {
-// wxeRefData *refd = it->second;
-// if(refd->ref >= global_me->next)
-// fprintf(stderr, "L %d %d\r\n", refd->ref, refd->alloc_in_erl);
-// }
-// fflush(stderr);
+// // Assert ?
+// for(ptrMap::iterator it = ptr2ref.begin(); it != ptr2ref.end(); it++) {
+// wxeRefData *refd = it->second;
+// if(refd->ref >= global_me->next)
+// fprintf(stderr, "L %d %d %d\r\n", refd->ref, refd->type, refd->alloc_in_erl);
+// }
+// fflush(stderr);
delete memenv;
driver_pdl_dec_refc(Ecmd.pdl);
refmap.erase((ErlDrvTermData) Ecmd.port);
@@ -650,12 +650,12 @@ int WxeApp::getRef(void * ptr, wxeMemEnv *memenv) {
ptrMap::iterator it = ptr2ref.find(ptr);
if(it != ptr2ref.end()) {
wxeRefData *refd = it->second;
- if(refd->memenv == memenv) {
+ if(refd->memenv == memenv || refd->memenv == global_me) {
// Found it return
return refd->ref;
} // else
// Old reference to deleted object, release old and recreate in current memenv.
- clearPtr(ptr);
+ ptr2ref.erase(it);
}
int ref;
intList free = memenv->free;