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

RE: Weird errors



Just wanted to thank you all for your informative and helpful responses.  I
am amazed at the friendly and helpful people on this list!  Thank you very
much.

I am deallocating the findParams at the very end of the program - the only
thing I am doing after that is ending the session, I thought that would be a
good place to do it.  I will try to change the place I deallocate them and
see if that helps.  If I have several params that I need to deallocated
(find, save and open) does it matter in which order I deallocate them?

I will play with this a little more but I may take some of you up on your
offer to look at my code.  I am new to both C and Frame so it may not be the
prettiest code and I am sure I could learn a lot from your feedback.

Thanks again, I hope that soon I can be answering questions instead of
always asking them!

Sue

-----Original Message-----
From: Steve Kubis [mailto:steve.kubis@greatplains.com]
Sent: April 26, 2001 4:43 PM
To: Mitchell, Sue; framers@omsys.com
Subject: 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.   **