From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <9803301919.AA14742@clio.rice.edu> Subject: Re: djgpp malloc and freeing memory on exit To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Mon, 30 Mar 1998 13:19:39 -0600 (CST) Cc: eldredge AT ap DOT net, edc AT arches DOT uga DOT edu, djgpp AT delorie DOT com In-Reply-To: from "Eli Zaretskii" at Mar 30, 98 08:30:35 pm Content-Type: text Precedence: bulk > Does the above include the DPMI calls that create selectors, like > allocate DOS memory, segment-to-descriptor, etc., when they are issued by > a nested program? In other words, if a nested program allocates a > selector with one of these calls and doesn't explicitly free it before > exiting, will it only be freed when the parent application exits? DOS memory seems to be cleaned up in all cases, but the associated selectors do not seem to be cleaned up. I would suggest that if you call any of the DPMI functions directly that you do whatever cleanup is possible in an exit handler to make sure those resources are cleaned up if the program is called in a nested manner. It's not critical - if you lose an extra selector each call you may only be able to run it 1500 times before failure instead of 2000 times...