🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #356

Re: Resource in iv 3.01

#356
From: Mark Linton
Date: Fri, 17 Apr 1992 18:47
19 lines
1534 bytes
In article <1992Apr14.232745.12859@crd.ge.com>, hoffman@albirio.NoSubdomain.NoDomain (William A. Hoffman) writes:
|> 	I am using the 2.6 compatibility mode in iv 3.01.  Several of my classes
|> inherit from Subject which inherits from Resource.  My program had a large
|> memory leak because of the following:
|>  ...
|> All my code is going to be executed from the e.handle() call.  In effect this
|> means that Resource::defer is defaulted to true not false as it is stated in
|> the manual.   
|> 
|> 	Is this a bug or a feature?  Should I wrap all my code that is called
|> from handle functions with:
|> 
|> 	b = Resource::defer(false); my code;  Resource::defer(b);  

This is a feature.  It is common during the process of event handling
to want to "free" an object with an active method on the stack.
So we defer all destruction until after each event is handled.
If you want memory to be freed during the execution of your event handler,
then you do need to turn off deferral.
Technical Details
Message-ID: <jlsept0@fido.asd.sgi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!ames!sgi!fido!marktwain.rad.sgi.com!linton
References: <1992Apr14.232745.12859@crd.ge.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!ames!sgi!fido!marktwain.rad.sgi.com!linton
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.windows.interviews
Subject: Re: Resource in iv 3.01
Keywords: memory leak, subject, resource
Message-ID: <jlsept0@fido.asd.sgi.com>
Date: 17 Apr 92 18:47:14 GMT
Article-I.D.: fido.jlsept0
References: <1992Apr14.232745.12859@crd.ge.com>
Sender: news@fido.asd.sgi.com (Usenet News Admin)
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
Organization: sgi
Lines: 19