Skip to content

Commit daf94c7

Browse files
committed
Clear SWIG object only, without checking ownership
Because SWIG-ownership gets dropped when the Fox object is assigned to some other Fox object.
1 parent 260eca7 commit daf94c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/fox16_c/FXRbObjRegistry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ void FXRbObjRegistry::UnregisterRubyObj(const void* foxObj, bool alsoOwned){
108108
if( !alsoOwned && desc->type!=borrowed ) return;
109109
FXTRACE((1,"FXRbUnregisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)desc->obj,safe_rb_obj_classname(desc->obj),foxObj));
110110

111+
/* Release unless it's already T_ZOMBIE */
111112
if(RB_TYPE_P(desc->obj, RUBY_T_DATA)) {
112-
/* Release unless it's already T_ZOMBIE */
113-
int res = SWIG_ConvertPtr(desc->obj, NULL, NULL, desc->type==borrowed ? SWIG_POINTER_CLEAR : SWIG_POINTER_RELEASE);
113+
int res = SWIG_ConvertPtr(desc->obj, NULL, NULL, SWIG_POINTER_CLEAR);
114114
if (res != SWIG_OK){
115115
rb_bug( "UnregisterRubyObj(rubyObj=%p) error: %d", (void*)desc->obj, res);
116116
}

0 commit comments

Comments
 (0)