Skip to content

TMQuiltView memory leak #12

Description

@haitaoli

dealloc code releases _reusableViewsDictionary first, but then cleanupColumns code path will re-create the dictionary and leak all objects in it. The fix is to move cleanupColumns to the beginning of dealloc.

  • (void)dealloc {
    [_indexPaths release], _indexPaths = nil;
    [_reusableViewsDictionary release], _reusableViewsDictionary = nil;
    [_rowsToInsert release], _rowsToInsert = nil;
    [_rowsToDelete release], _rowsToDelete = nil;

    [self cleanupColumns]; <== leaks _reusableViewsDictionary

    [self removeGestureRecognizer:self.tapGestureRecognizer];
    [_tapGestureRecognizer release], _tapGestureRecognizer = nil;

    [super dealloc];
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions