Hi Rick,
I realized I might be doing something wrong in ooDialog. Maybe not
strictly wrong but using up more memory than I should be.
As you probably know, in Windows, you have the window message
processing loop. I do an attach thread when the loop is initialized
for a dialog and keep the thread context pointer until the loop is
ended, and then do the detach thread.
During the loop, as window messages come in, if the message is one the
dialog wants to be notified of, I use the thread context to
SendMessage directly to the dialog.
Now, for many of these send messages, I construct an argument array,
of Rexx objects, to send to the dialog. But, I haven't been doing a
local release for any of these Rexx objects sent as arguments, or the
array itself for that matter.
After the SysFileTree discussion, I'm thinking maybe all those objects
created in the thread context are not being garbage collected until
the thread context is released. Should I be doing a local release on
these objects after the return from the send message? Also, the
return object from the SendMessage after I decode it?
In this snippet of code, c by the way is the thread context pointer here:
pCTvCustomDrawSimple pctvcds =
(pCTvCustomDrawSimple)c->BufferData(tvcdsBuf);
memset(pctvcds, 0, sizeof(CTvCustomDrawSimple));
pctvcds->drawStage = tvcd->nmcd.dwDrawStage;
pctvcds->item = (HTREEITEM)tvcd->nmcd.dwItemSpec;
pctvcds->level = tvcd->iLevel;
RexxObjectPtr custDrawSimple =
c->SendMessage1(TheTvCustomDrawSimpleClass, "NEW", tvcdsBuf);
if ( custDrawSimple != NULLOBJECT )
{
RexxObjectPtr msgReply = c->SendMessage1(pcpbd->rexxSelf,
methodName, custDrawSimple);
I use a RexxBuffer as the memory backing for a TvCustomDrawSimple
object and send the object as an argument to a method in the Rexx
dialog. I was thinking that the memory would get garbage collected
because I was using the RexxBuffer and there were no references to the
custDrawSimple object in any Rexx objects.
But, now I'm thinking maybe I need to do a local release on
custDrawSimple. Is that custDrawSimple object protected from garbage
collection until the thread context is released? Same thing for the
msgReply object returned from Rexx, is that also protected from
garbage collection until the thread context is released?
Thanks.
--
Mark Miesfeld
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel