Garbage leak? Bridge leakage scenario?

I am always very picky about memory leaks, and I don’t understand why my garbage collected the application. My code is completely memory managed and it works fine without garbage collection, not leakage. However, as soon as I turn on garbage collection, it flows!

Just to prove why this leak in garbage collection? (put this dummy code in applicationDidFinishLaunching :)

NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel beginSheetModalForWindow:window completionHandler:^(NSInteger result) {NSBeep();}];

Also, is there a way to prevent leaks in applications (garbage collector or others) that use Scripting Bridge? it seems like they are all flowing, even samples in xcode.

Thanks everyone!

+3
source share
2 answers

Here is a partial answer.

, , , . , , , .

C, Objective-C, .

, . Objective-C , , , . ( ) ( , C). , - .

, , ? ""? " GC"?

+2

, , "" . , . " GC". , , .

, GC.

, GC- ? ?

0

Source: https://habr.com/ru/post/1742739/


All Articles