RE: win32libs

new topic     » goto parent     » topic index » view thread      » older message » newer message

> -----Original Message-----
> From: Wolf [mailto:wolfritz at KING.IGS.NET]

> I've got two demo's in this zip.
> One, written for win32lib version 0.55.1, GPF's frequently, 
> on *closing*.
> The other, re-written for version 0.51, *never* seems to do this....
> ..darn !!!
> Tests, and feedback, appreciated.

OK, I still can't explain _why_ the crash happens, but I think I know how to
avoid it.  At least, I can't duplicate the GPF anymore.  I checked the win32
docs, and HeapDestroy will free anything that was allocated before getting
rid of itself.  So instead of freeing memory blocks one at a time, I
switched to using HeapDestroy for releasing all memory.  In addition to
being (seemingly) more stable, it should be a lot faster (not that I've
heard anyone clamoring for speedy shutdowns):

--tk_mem.e

global procedure release_all_mem()
    atom VOID

    -- Matt Lewis 3/14/01
    -- changed this to avoid GPF on close
    if pHeap then

	  VOID = c_func(xHeapDestroy,{ pHeap })
    
        -- reinitialize variables
        pAllocated = { {}, {} }
        pHeap = 0
        pAllocationCounter = 0
        pAllotted = 0
        pStringSet = 0
    end if

end procedure

Wolf, see if that solves your problem.  If so, we ought to update tk_mem,
Derek.

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu