Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

EXC_BAD_ACCESS when deallocating RBLPopover #75

Closed

Description

@3rdcycle

Disclaimer: I'm new to this stuff and might simply be doing something wrong.

Deallocating an RBLPopover that was initialized with an RBLViewController causes the app to crash with EXC_BAD_ACCESS in custom_viewWillMoveToWindow: when accessing self.rbl_viewController. My guess is that the associated rbl_viewController already got dealloced and left a dangling pointer.

Here's how I setup the popover:

- (IBAction)showPopover:(id)sender {
    PopoverContentViewController *contentViewController = [[PopoverContentViewController alloc] initWithNibName:@"PopoverContentViewController" bundle:nil];

    self.popover = [[RBLPopover alloc] initWithContentViewController:contentViewController];
    self.popover.behavior = RBLPopoverViewControllerBehaviorTransient;
    [self.popover showRelativeToRect:self.button.bounds ofView:self.button preferredEdge:CGRectMinYEdge];
}

I can send a minimal working example if needed.

Activity

  1. jspahrsummers commented on Mar 25, 2013

    @jspahrsummers
    Contributor

    Thanks for reporting this! Seems like we aren't zeroing out rbl_viewController properly. We'd be happy to review a pull request fixing this, if anyone wants to take a stab at it.

  2. anozaki commented on May 13, 2013

    @anozaki
    Contributor

    The fix I put in does fix this issue but the problem lies else where for the code snippet in this bug.

    The problem is contentViewController is going out of scope and getting deallocated at the end of this function.

  3. 3rdcycle commented on Jun 3, 2013

    @3rdcycle
    ContributorAuthor

    Thanks.
    I think RBLPopopver retains the contentViewController, so it should be fine.

  4. jspahrsummers commented on Jul 5, 2013

    @jspahrsummers
    Contributor

    Should be fixed by #85.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions