Skip to content

Commit

Permalink
destroy context and texture to fix memory leak; bump 0.0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Nov 20, 2020
1 parent 8cc4bb1 commit b0b90ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion json_paint.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.0.16"
version = "0.0.17"
author = "jiyinyiyong"
description = "JSON DSL for canvas rendering"
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions src/json_paint.nim
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ proc renderCanvas*(tree: JsonNode) =
let mainTexture = renderer.createTextureFromSurface(mainSurface)
renderer.copy(mainTexture, nil, nil)
renderer.present()
mainTexture.destroy()

proc takeCanvasEvents*(handleEvent: proc(e: JsonNode):void) =
var event: sdl2.Event
Expand Down

0 comments on commit b0b90ee

Please sign in to comment.