[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

RE: Weird errors



I can add a little to the discussion about deallocating, based on my own
experiences.

I agree with the statement that the FDK is rather touchy with
deallocation. Rather, the Windows version of the FDK is touchy. The Mac
version lets you get away with terrible, horrible things that could
really mess up memory. That's why I like to compile and run on lots of
platforms. You can find and resolve lots of issues that way.

As for deallocating param lists, the main issue I've found is dealing
with strings in the param lists. If you leave the string parameters
alone, then you never seem to have problems. If you change the values of
string parameters, problems seem to crop up. A common problem seems to
be deallocating a string that you set a parameter value to, then trying
to deallocate the parameters. Basically, you're trying to let go of
something that you've already dropped, which isn't legal. I've had
better luck with setting string parameters to copies of string values,
using F_StrCopyString().

If you can't resolve an issue with deallocation, it's not horrible to
leave a parameter list or two unallocated. That will use up some memory,
but not gobs. It shouldn't cause a crash. Where you may run into an
issue is not deallocating memory 10,000 times in a loop. Leaking memory
just doesn't scale well. :-)

Hope this helps.

Steve

** To unsubscribe, send a message to majordomo@omsys.com **
** with "unsubscribe framers" (no quotes) in the body.   **