AQGridView
AQGridView copied to clipboard
Leaks When Calling reloadData
I created a new project to isolate the issue - see the implementation for this: https://gist.github.com/ee3d7b2204d2f4b9a214
As soon as reloadData is called there are two immediate leaks in -[AQGridView(AQCellLayout) updateVisibleGridCellsNow](li 1544).
Hm, might have cropped up due to ARC migration. Right now I don't see anything wrong with the code-- presumably the ARC handler isn't correctly placing the calls to deallocate everything. Can you confirm that no exceptions are being caught in that method?
Setting a breakpoint in the @catch block and adding a logger statement yielded no result. It doesn't seem to be catching anything. I can send a zip of the test project if that would be helpful.
That's okay— I'll take a look later on today.
Hello, I just upgraded to version 1.2 and I experience the same problems on calling reloadData. If selection is enabled the application crashes on reloadData, if selection is disabled (with cell.selectionStyle = AQGridViewCellSelectionStyleNone) the application does not crashes but there are memory leaks. In version 1.1 there was no problem in reloadData (I upgraded to version 1.2 because gridFooterView doesn't work well in 1.1 in landscape mode). Is there any solution? I'm a newbie in iOS programming, but can I help in some way?
Andrea
PS: Analyze in XCode gives many potential leaks in AQGridView.m and AQGridViewAnimatorItem.m
I've noticed the same crashing problem (EXC_BAD_ACCESS) as apierini except it only happens to me if the grid is scrolling and I call reloadData - at least that is what appears to be happening as the first call to reloadData when the view loads doesn't cause a crash. The crash I get is in "resetHighlightForSubviewsOfView" on the line:
NSMutableDictionary * info = (NSMutableDictionary *) objc_unretainedObject(CFDictionaryGetValue( _selectionColorInfo, objc_unretainedPointer(view) ));
As stated above it doesn't crash if selection style is AQGridViewCellSelectionStyleNone.
I have very similar issue on updateVisibleGridCellsNow and I am not using ARC. AQGridView leak NSIndexSet objects which are copied by mutableCopy method. It seems that it could be solved by adding autorelease call to all the copied object. I did so and now have no leak found on Instrument. I guess this issue happens only if not using ARC.
I also encoutered the same crash as explained by @Aaronov and others.
I'm not using ARC, first call to reloadData goes well but each other call crashes the app (EXC_BAD_ACCESS). Using AQGridViewCellSelectionStyleNone fixed the problem for now.
Yes, setting AQGridViewCellSelectionStyleNone fixed the problem for now.
Running across a similar issue when just trying to set a selection style on my custom AQGridViewCells.