It doesn't seem so to me.
AFAIK deleteLater and autorelease pools are a way of postponing cleanup until sometime after execution returns to the message loop.
That's not useable for implementing something like a graph class.
AFAIK deleteLater and autorelease pools are a way of postponing cleanup until sometime after execution returns to the message loop.
That's not useable for implementing something like a graph class.
So
@autorelease {
[NSMutableArray array];
}
---> the array disappears here
More precisely, the array gets an additional release at that point, so if someone else has retained it, it will stick around. The part about the message-loop is also true: by default, the AppKit creates a pool when it runs the message loop -messageLoop
{
@autorelease {
handle one iteration of the loop
}
}
So that's the default behaviour you get if you don't do anything else, but you can go as fine in terms of granularity as you want (and the overhead of doing that is pretty minimal and has gotten less with time).How about Qt's management of QObjects through QObject's parent/child relationship?[1]