AsyncUpdater


#1

hi,

I don’t know if it’s me or not but I got a crash in AsyncUpdater::messageCallback(), with an invalid owner address (0x3d). Why not use a WeakPointer instead of a reference?
By reading the code though, it seems that the case of an invalid owner ref with a valid shouldDeliver flag shouldn’t happen.

The callstack doesn’t say much because this is async. All I can say is that all is happening on the Main thread.


#2

I think the only way that can happen is if you’re deleting your asyncupdater object on a background thread without a messagemanagerlock. There’s an assertion to warn you about that, but maybe it didn’t trigger…?

There should be no need for a weak-reference because the owner will turn off the shouldDeliver flag when it’s deleted, which will stop the message using the pointer. I’d expect to see what you’re describing if you called triggerAsyncUpdate() during/after your asyncupdater’s destructor too.


#3

a priori there’s no AsyncUpdater destruction happening in a background thread. and the assertion in AsyncUpdater’s destructor did’t trigger either.

I agree that the code looks right. Since I got this bad access only once during a debug session, I can’t say much more. In case someone else sees this that might ring a bell.


#4

I’d be keen to hear if you can reproduce it or find out any clues. If your asyncupdater is always deleted on the message thread, then the only way I can see that happening would be if a background thread tries to call it when it’s a dangling pointer.


#5

I’ll let you know if I reproduce it