Post

Replies

Boosts

Views

Activity

Reply to why is autoreleasepool releasing objects that were retained?!
I'm using the code for my Core ML model that's automatically generated by XCode. The files say not to modify them at the top, and the files themselves seem to be stored outside of my project, so I'm not sure if any modifications would even persist. So, the MLMultiArray member variables are declared the way they're declared. As for ARC, I've never used it before and I wasn't sure it would give me the behavior I wanted. (How would it know when to free the output of the prediction?)
Topic: Programming Languages SubTopic: General Tags:
Sep ’22
Reply to why is autoreleasepool releasing objects that were retained?!
Thank you for your reply. It sent me in the right direction. I was able to figure out that my output object was actually being retained as intended, but its constituent data (two MLMultiArray member variables) were being freed. I didn't realize that's how things worked. I've been able to solve the problem by calling retain on the MLMultiArrays. Thanks again. You're also right that I was using the term "leak" the wrong way. I'm working on a command line program and it doesn't have an event loop. So NSObjects don't get freed unless I do something to manually free them. I didn't really understand that last night but I've been learning.
Topic: Programming Languages SubTopic: General Tags:
Sep ’22