Help needed in debugging a problem


I’m pulling my hair out trying to find a fix to a problem I’m having and need some advice. I have an app that usees the standalone filter wrapper. Users open patches that tell the app how many sliders/buttons etc. should be present. As soon as the user selects a patch I call the resetfilter() which destroys the last filter and creates a new one. My problem is that every so often I will open a patch and my app will just hang. When I say hang I mean it will popup but will contain nothing but screen rubbish. Taking out setContentComponent() in my reset filter function will prevent the hang. Obviously that’s not a solution. If I step through setCotentComponent() I get taken to createEditorIfNeeded() which in turn creates a ScopedLock which brings me to CriticalSection::enter() at which point my debugger return to my application which is just hanging. I don’t know where to start? My debugger is not picking up any problem yet my app continues to hang. Different patches work but as of yet I’m not seeing why some work and some don’t. Can anyone think of anything I might do or try in order to get to the bottom of this?


can you post some code? what does your resetFilter look like? are you deleting and creating a new filter there?


filter = createPluginFilter();

if (filter != 0)
if (deviceManager != 0)
deviceManager->setFilter (filter);

setContentComponent (filter->createEditorIfNeeded(), true, false);



Thanks Aiit. I do indeed delete and create a new filter in my resetFilter() method. In preparing some code for you to look at I’ve come across a few other odd things that could be causing my problem. I’ll hunt them down first and if I can’t find the problem I’ll get back to you. Thanks again for taking the time to post a reply.



Just to report that I found the problem. Resetting my filter is fine so long as I hold of starting the processing until everything is ready. A simple call to suspendProcessing() seems to have done the trick. Thanks for the help. The problem I believe was a direct result of some poor programming!