Here is an interesting point also, given what you stated Frank; what will we
do when we have a sub-routine that we want to *return* an ActiveX object?
It seems to me that it would be best, from a memory standpoint, to release
the object(s) within the sub-routine, return the handle and get the object
_again_ (grr) in the parent routine via HandleToObject.
--
R. Robert Bell, MCSE
http://www.acadx.com
"Frank Oquendo" wrote in message
news:65BC4DA2E9031BB298B0E26DD074E928@in.WebX.maYIadrTaRb...
| Making a VLA-object local is no guarantee that AutoCAD will reclaim
| unused memory. You must bind a VLA-object reference to a symbol and
| call vlax-release-object against that symbol. Any other combination
| locks up RAM until AutoCAD is shut down.
|
| --
| "That's no ordinary rabbit."
| http://www.acadx.com
|
| Visit my site for a chance to win
| a free, autographed copy of
| Jerry Winters' "AutoCAD Visual Basics"
|
| "John Uhden" wrote in message
| news:E4806896CAC290E580455523C70B7E62@in.WebX.maYIadrTaRb...
| > I'll take a chance on disagreeing with you.
| >
| > From the help on vlax-object-released-p:
| >
| > "NOTE Erasing a VLA-object (using command ERASE or vla-erase) does
| not
| > release the object. A VLA-object is not released until you either
| invoke
| > vlax-release-object on the object, normal AutoLISP garbage
| collection
| > occurs, or the drawing database is destroyed at the end of the
| drawing
| > session."
| >
| > Notice the garbage collection phrase. Strikes me that either using
| a
| > fuction with local variables bound to the VLA-OBJECT, or setting the
| symbol
| > nil followed by a forced (gc) should free up the memory.
| >
| > BTW, I found that the memory usage is per namespace. I can release
| an
| > object in the drawing namespace, without affecting its status in the
| > separate namespace.
| >
| > --
| > John Uhden, Cadlantic/formerly CADvantage
| > --> mailto:juhden@cadlantic.com
| > --> http://www.cadlantic.com
| > 2 Village Road
| > Sea Girt, NJ 08750
| > Tel. 732-974-1711
| > FAX 732-528-1332
| >
| > "Frank Oquendo" wrote in message
| > news:71EDE8FA31F1AF9541D26B41CFADFC5E@in.WebX.maYIadrTaRb...
| > > In order to mark the memory being used by a VLA object as
| reclaimable,
| > > it must be explicitly released. Otherwise, it's lost until you
| restart
| > > AutoCAD.
| >
| >
| >
|
|