Hello!
I want to get the current date in a infinite while loop. I accomplish this by doing like this:
method LPIController.startTimer;
begin
while true do
begin
using autoreleasepool do
begin
var date:= NSDate.date;
end;
end;
end;
method LPIController.setDataSource(aLPIDataSource: ILPIDataSource);
begin
fLPIDataSource:= aLPIDataSource;
self.performSelectorInBackground(selector(startTimer)) withObject(nil);
end;
As you can see the “startTimer” routine runs asynchronously.
I have no idea why the Instruments shows a continuously growing great amount of NSDate. So far, I thought that the auto-release pool would release the date each pass.
Do you have any ideas of how to fix this ?
Reproduced with File|New|MacApp and this code added:
method AppDelegate.applicationDidFinishLaunching(aNotification: NSNotification);
begin
fMainWindowController := new MainWindowController();
fMainWindowController.showWindow(nil);
self.performSelectorInBackground(selector(startTimer)) withObject(nil);
end;
method AppDelegate.startTimer;
begin
loop begin
using autoreleasepool do begin
var date:= NSDate.date;
end;
end;
end;
Hi Mark,
is there any hotfix or workaround? I need to release an App having this issue in the next few days. Unfortunately, the current beta doesn’t address this bug.
I’ll make sure this gets looked at first thing Monday and we can shoot you an interim beta build, if needed. Sorry about this not having been fixed for today’s beta yet.
If you let me know what your username on remobjects.com is (here or via private message/email to info@) i can put a new build with this fix into your Personal Downloads folder, later today.