Since Update 3 didn't fix it, I've decided to try your suggestion. I've created a task which simply calls IDoMethod(PM_OPEN) for testing, but it gives me an error that I'm trying to call Open() from a task (I'm not, and I'm not sure why PM_OPEN would be either), and then promptly deadlocks exactly the same as before but with this message on screen instead.
Is there any way I can find out what is accessing memory illegally or some way of tracking this down?
btw, even if I strip the entire menu creation out of my code, PM_OPEN still deadlocks. I effectively have this:
Code: Select all
ctxmenuobj = NewObject( POPUPMENU_GetClass(), NULL,TAG_DONE);
I don't see how anything can be at fault here except popupmenu.class, unless something else is trashing popupmenu.class' memory - however I wouldn't expect that to happen so consistently. I've yet to try it on another computer although I'm not entirely sure what that will prove. popupmenu.class does work here, it just doesn't work in this program since some changes unrelated to this code - which is why I'm thinking it might be an alignment problem.
I was going to try updating it to use OpenClass() but I don't think I can, due to the weird hybrid POPUPMENU_GetClass/POPUPMENU_GetItemClass thing.
(I've also tried rearranging the linking order, changing compiler flags - optimisation etc - and still getting the deadlock, I'm out of ideas)