Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory Leak
#6
(05-10-2023, 02:27 AM)NasaCow Wrote: Never noticed it before but my menu selection screens have a memory leak! It keeps adding about 8MB/s of system memory. It is a pretty forward loop and the MOUSE calls are not the source (they were all commented out when I was trying to locate the source of the leak). I am really at a loss here....

Code: (Select All)
    DO
        LIMIT LIMITRATE
        CLS
        PUTIMAGE (0, 0), BGImage
        MENUMAKER Menu()
        SELECT CASE Pointer
            CASE 0: PUTIMAGE (MenuPos(2).X1 - 50, MenuPos(2).Y1 + 10), CheckSelect
            CASE 1: PUTIMAGE (MenuPos(3).X1 - 50, MenuPos(3).Y1 + 10), CheckSelect
            CASE 2: PUTIMAGE (MenuPos(4).X1 - 50, MenuPos(4).Y1 + 10), CheckSelect
            CASE 3: PUTIMAGE (MenuPos(5).X1 - 50, MenuPos(5).Y1 + 10), CheckSelect
        END SELECT
        DISPLAY
        IF SelectFlag THEN PAUSE TIME 'Avoid double press delay
        SelectFlag = FALSE 'reset input

        'Checking for key press (keyboard)
        IF KEYDOWN(CVI(CHR$(0) + "H")) THEN ' up case
            IF Pointer = 0 THEN Pointer = 3 ELSE Pointer = Pointer - 1
            SelectFlag = TRUE
        END IF
        IF KEYDOWN(CVI(CHR$(0) + "P")) THEN 'down case
            IF Pointer = 3 THEN Pointer = 0 ELSE Pointer = Pointer + 1
            SelectFlag = TRUE
        END IF

        'Checking for mouse input
        MOUSE "Poll"
        MOUSE "Release"
        MOUSE "Action"
        MOUSE "Loop"
    LOOP UNTIL KEYDOWN(13) OR KEYDOWN(32) OR MFlag 'Return/space bar/mouse click to select


[Image: image.png]
(Using almost 3 times as Chrome after a few mins...)

It seems to only happen on Menu selection screens. The leak appears in all V4 releases from me but V3 does not have the leak. Any thoughts what it may be?

If any additional code is needed or anything else of the sort, please let me know!!


I would like to see your mouse code. I am trying to add it to my game, but I am having a lot of problems Sad
10 PRINT "Hola! Smile"
20 GOTO 10
Reply


Messages In This Thread
Memory Leak - by NasaCow - 05-10-2023, 02:27 AM
RE: Memory Leak - by TerryRitchie - 05-10-2023, 02:34 AM
RE: Memory Leak - by SMcNeill - 05-10-2023, 03:01 AM
RE: Memory Leak - by NasaCow - 05-10-2023, 04:23 AM
RE: Memory Leak - by SMcNeill - 05-10-2023, 05:13 AM
RE: Memory Leak - by Ikerkaz - 05-10-2023, 11:12 AM
RE: Memory Leak - by bplus - 05-10-2023, 01:27 PM
RE: Memory Leak - by Ikerkaz - 05-10-2023, 02:35 PM
RE: Memory Leak - by bplus - 05-10-2023, 04:55 PM
RE: Memory Leak - by NasaCow - 05-11-2023, 12:25 AM
RE: Memory Leak - by Ikerkaz - 05-11-2023, 02:40 PM
RE: Memory Leak - by SMcNeill - 05-11-2023, 02:48 PM
RE: Memory Leak - by TerryRitchie - 05-11-2023, 03:43 PM



Users browsing this thread: 15 Guest(s)