Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak Creating New Pics #48

Open
redstarcoder opened this issue Oct 2, 2018 · 0 comments
Open

Memory Leak Creating New Pics #48

redstarcoder opened this issue Oct 2, 2018 · 0 comments

Comments

@redstarcoder
Copy link

If you create many images, despite using Pic.Free, Turing will ultimately consume all the memory it's allowed to and crash. Code:

View.Set ("graphics:1024;600,offscreenonly")

var spinbox, newbox, angle : int
angle := 0

Draw.FillBox (50, 50, 150, 150, brightcyan)
spinbox := Pic.New (0, 0, 200, 200)
newbox := Pic.Rotate (spinbox, angle, 100, 100)

loop
    cls

    angle := angle + 4
    if angle >= 360 then
        angle := 0
    end if
    Pic.Free (newbox)
    newbox := Pic.Rotate (spinbox, angle, 100, 100)
    
    Pic.Draw (newbox, 600, 300, picCopy)
    
    View.Update ()
    delay (10)
end loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant