Menu

#2 Demo Nav dialogs crashing in OS X

open
nobody
None
5
2004-02-27
2004-02-27
No

In the demo app, whenever I tried to save a file, the demo was
crashing with an access violation. The crash goes away if you
remove the DisposeNavEventUPP calls. To avoid a leak, instead of
allocating a new UPP each time you use one, just allocate the UPP
once and keep it in a static variable, for instance:

static NavEventUPP GetEventFilterUPP()
{
static NavEventUPP sFilterUPP = NULL;
if (sFilterUPP == NULL)
{
sFilterUPP = NewNavEventUPP( NavEventFilter );
}

return sFilterUPP;
}

Discussion


Log in to post a comment.