Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_mem
#8
(01-01-2025, 10:27 AM)Jack Wrote: Big Grin 
Ok, I get what you are saying but it makes no sense, even if _MEM is a structure why is it not freed automatically just like a udt ?

Mem is set up very similar to OPEN file$ FOR BINARY..

Think of this:

Code: (Select All)
Do
    foo
Loop Until _KeyHit

Sub foo
    f = FreeFile
    Open "temp.txt" For Binary As #f
    Print f
End Sub

Now, without a CLOSE statement, the above is going to also be a memory leak.  f is going to always increase handles for that file, and eventually you're going to run into issues somewhere.

Of course, it'll all close when the program closes, but if you want to prevent memory leaking, close it when you're done with it.  There's no logic attached to do it automagically for you.  Wink
Reply


Messages In This Thread
_mem - by Jack - 12-31-2024, 09:52 PM
RE: _mem - by DSMan195276 - 01-01-2025, 07:11 AM
RE: _mem - by Jack - 01-01-2025, 09:08 AM
RE: _mem - by Jack - 01-01-2025, 10:01 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:18 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:10 AM
RE: _mem - by Jack - 01-01-2025, 10:27 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:36 AM
RE: _mem - by Jack - 01-01-2025, 10:40 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:45 AM
RE: _mem - by Kernelpanic - 01-01-2025, 11:55 PM
RE: _mem - by DSMan195276 - 01-01-2025, 11:13 PM
RE: _mem - by DSMan195276 - 01-02-2025, 12:27 AM



Users browsing this thread: 2 Guest(s)