]> granicus.if.org Git - transmission/commitdiff
Send dummy events each second to prevent excessive memory use (inspired by xnyhps)
authorMike Gelfand <mikedld@mikedld.com>
Sat, 18 Apr 2015 21:45:37 +0000 (21:45 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Sat, 18 Apr 2015 21:45:37 +0000 (21:45 +0000)
I'm not that good in Mac programming it seems as I can't figure out why
doesn't the memory being allocated by frequent NSNewBitmapBackingStore
(system internal) calls being freed even if I wrap the code into
@autoreleasepool explicitly. Disabling animations does slow it down but
not stop. This commit is certainly a dirty fix but it seems to work in
my case and I hope it helps a few other people while we wait for a
proper solution.

macosx/Controller.m

index a4ace8927c9e1a9f746875dda01d95276142d06f..f983507c44ff42c6dcda5c714394a22122449a8e 100644 (file)
@@ -590,6 +590,9 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
     [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
     [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
     
+    #warning FIXME: https://forum.transmissionbt.com/viewtopic.php?f=4&t=16519
+    [NSEvent startPeriodicEventsAfterDelay: 0 withPeriod: 1];
+
     [self applyFilter];
     
     [fWindow makeKeyAndOrderFront: nil];