views:

59

answers:

2

Hi guys - I was at client site today and made a couple of bug fixes there and then. I deployed the working copies of the app to their iPads and iPhone. Perfect. I have come home and now run the app in the Simulator.... but it crashes each time and I cannot figure out how. Unfortunately, I cannot see what I have changed which would cause this.

Does anyone know why you'd see the error message Program received signal: “EXC_BAD_ACCESS” on the simulator and not the iPad or iPhone?

I'm using Xcode 3.2.4 with OS4.1 on the iPhone 3GS and iPad 3.2.2 running on OSX 10.6.4

Thanks for any information. I'm tearing my hair out....!

[update]

here's the code where it's failing

- (void)dealloc
{
if (_node)
    {
    if (_node->_private == self) //THIS IS THE LINE that debug is stopping on
        _node->_private = NULL;
    _node = NULL;
    }
//
[super dealloc];
}
+1  A: 

IS there any chance that this object isnt being retained properly? The Simulators memory is reused very quickly, thus if a pointer's retain count becomes 0, it will remap quickly and on the next access things can blow up.... reuse of memory in my experience is slower on the devices. Depending on the object;s type you can use CFGetRetainCount or [_node->_private retainCount];. If the object still breaks there isnt one.

grmartin
It was an issue with the builds and simulator - maybe the simulator memory was upset! I deleted all builds, closed everything and restarted. Seems to have solved the problem. Very strange.
Matt Facer
A: 

That _node is used strangely. From your use of -> it appears to be a pointer. But you then set it to NULL. That's a very odd way to free a pointer or remove a reference to it.

Are you freeing the _node elsewhere? Maybe _node is being freed before this is called. That would give you a problem when you try to work with it.

No one in particular