Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to avoid leaks with Cocoa functions?
Answer: You can try this code on Mac OS X:
// in a Timer Action event:
Sub Action()
static LastPool as NSAutoreleasePoolMBS = nil
static CurrentPool as NSAutoreleasePoolMBS = nil

LastPool = CurrentPool
CurrentPool = new NSAutoreleasePoolMBS
End Sub
With REALbasic 2009r4 the code above should not be needed as REALbasic runtime does automatically handle the NSAutoreleasePools for you. For older REALbasic versions you need to use code with a timer with the action event above to avoid memory leaks.

Please do not use REALbasic 2009r4 and newer with plugins before version 9.5. You can get crashes there which typically show a line with a objc_msgSend call.

Feedback, Comments & Corrections

MBS Xojo tutorial videos