General information
Title:
Memory Leak/VFP Gone Wonky
I'm having a bugger of an odd problem relating to a class I've written to handle tracking open tables and restoring them automatically.
The object is typically created ias a LOCAL var, and its Destroy() method is used to clean up after itself whenever it goes away.
It's been working fine, but recently, some testing has revealed a bizarre problem caused somewhere in its guts.
It's a hell of a problem because the symptoms are divorced from the cause (as far as I can tell). I have no idea what the cause is (although I suspect it has something to do with some kind of memory problems -- leak, bad pointer, etc.). The symptoms arre:
* I get a Data Type Mismatch error in a RETURN statement such as "RETURN lnCosts", where costs is a numeric.
FOLLOW-UP: the value of lnCosts is in some way hammered, because if I try to print its value with the ? command, I get an Internal Consistency Error and VFP bombs out. The same thing happens if I try to view the var in the debugger's Watch window. However, if I set "X = lnCosts", I can print and return X without a problem.
* I get certain variables being redefined. For example, I have a LOCAL variable y, and when I call a certain subroutine (without passing in y or any variable bound to y), y is reset during the declaration of variables in the sub.
FOLLOW-UP: If I change a LOCAL definition to a PRIVATE one in the sub, WHICH variable in the calling context gets rest it changed. Also, if I make the sub's declaration PUBLIC, no problem ocurss. NOTE: there is no name sharing going on in these subs (i.e., y is never used as a different var in the sub).
* I get an "ILLEGAL REDEFINITION" error on the first line of a function "LOCAL loObject". That would seem to be an impossible error given that it's the first line of the function.
The problem with these issues is that I can investigate themto some extent, but I have no idea what specifically could be causing them to occur, so I really have little sense of where to start looking.
Any leads appreciated.
-- jas
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only