Double Free error with ARC

Discussion in 'Mac Programming' started by cocoaADay, Dec 2, 2012.

  1. macrumors newbie

    Nov 1, 2012
    In my application, i'm using a view(say X), that has a webview, along with few other controls. On click of a button, i'm creating a tabview item & setting its view property to X.
    On clicking "Cancel" button, i'm removing this tabview item.

    Application is crashing when these steps are done -
    1. Press button(displays tabview item)
    2. Click cancel(removes tabview item)
    3. Press the button pressed in step 1 again.

    There is an issue with the webview. Say on step 1, the webview object was WebView: 0x10564bc00. When i press the same button again(step 3), i'm getting this message in console -
    malloc: *** error for object 0x10564bc00: pointer being freed was not allocated
    *** set a breakpoint in malloc_error_break to debug

    However now the webview object is changed to some 'xyz' value.
    Any suggestion on how to fix this?
    I'm using xcode 4.5 & ARC is enabled.

Share This Page