You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the (Haxe compatible) class that wraps Objective C objects is written in C++ (taken from HXCPP itself).
This is a problem in a sense that it increases the chances to break if HXCPP changes internals on how it implements Haxe classes in C++. It also makes it more difficult to add additional helpers on this wrapper class (like an explicit release() method).
Instead, we can create a regular Haxe class that wraps and retain an Objective-C object, and releases it when being destroyed.
We could provide an explicit release() method on this ObjcWrap class, but also automatically release the Objective-C object when the wrapper is being Garbage Collected, thanks to cpp.vm.Gc.setFinalizer().
At the moment, the (Haxe compatible) class that wraps Objective C objects is written in C++ (taken from HXCPP itself).
This is a problem in a sense that it increases the chances to break if HXCPP changes internals on how it implements Haxe classes in C++. It also makes it more difficult to add additional helpers on this wrapper class (like an explicit release() method).
Instead, we can create a regular Haxe class that wraps and retain an Objective-C object, and releases it when being destroyed.
We could provide an explicit release() method on this ObjcWrap class, but also automatically release the Objective-C object when the wrapper is being Garbage Collected, thanks to
cpp.vm.Gc.setFinalizer()
.(the setFinalizer() solution was already experimented there: https://github.com/jeremyfa/hx2objc/blob/master/hx2objc/IDHolder.hx)
The text was updated successfully, but these errors were encountered: