Hi Mindaugas,
On 2008.02.02., at 4:18, Javier wrote:
Mindaugas Kavaliauskas escribió:
What's wrong with my code?
mmmmh ... YA TA! "hb_fctx_destructor" is forbidden by the boss. You
should rename it with "My_destructor". :)
[ yes Javier, but also notice that indenting is just two
chars deep, not to mention the usage of 'begindump'.. :-P ]
I think the problem is that you're reassigning
'h' after debug( "1" ), which makes it lose it's
value, thus initiating the destructor, and at the
same time it won't get a new value, because myfunc()
will get the non-NULL parameter, which will be
reassigned to 'h' as is.
...
1. debug( "1" )
2. execute myfunc( h )
3. do nothing (value of ptr will just fall through), since h is not
NULL at this point
4. assign value to h
4a. free up old value of h
4b. call destructor ("destructor" displayed)
4c. assign new value to h (which equals to the old one)
5. debug( "2" )
...
Brgds,
Viktor
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour