mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Fix memory leak where the project remained referenced in BaseDraw even when its tab was closed
Another memory leak remains in Recorder.gd, where the first project forever remains referenced in memory, until the user changes the project from the option button. Perhaps we should remove that option button completely and always record the current project, that also sounds like the intended behavior to me.
This commit is contained in:
parent
e2971a8fe9
commit
8beb79a33b
|
@ -273,6 +273,8 @@ func draw_tool(pos: Vector2i) -> void:
|
||||||
|
|
||||||
func draw_end(pos: Vector2i) -> void:
|
func draw_end(pos: Vector2i) -> void:
|
||||||
super.draw_end(pos)
|
super.draw_end(pos)
|
||||||
|
_stroke_project = null
|
||||||
|
_stroke_images = []
|
||||||
_brush_size_dynamics = _brush_size
|
_brush_size_dynamics = _brush_size
|
||||||
if Tools.dynamics_size != Tools.Dynamics.NONE:
|
if Tools.dynamics_size != Tools.Dynamics.NONE:
|
||||||
_brush_size_dynamics = Tools.brush_size_min
|
_brush_size_dynamics = Tools.brush_size_min
|
||||||
|
|
|
@ -92,8 +92,8 @@ func draw_move(pos_i: Vector2i) -> void:
|
||||||
|
|
||||||
func draw_end(pos: Vector2i) -> void:
|
func draw_end(pos: Vector2i) -> void:
|
||||||
pos = snap_position(pos)
|
pos = snap_position(pos)
|
||||||
super.draw_end(pos)
|
|
||||||
if _picking_color:
|
if _picking_color:
|
||||||
|
super.draw_end(pos)
|
||||||
return
|
return
|
||||||
|
|
||||||
if _draw_line:
|
if _draw_line:
|
||||||
|
@ -105,6 +105,7 @@ func draw_end(pos: Vector2i) -> void:
|
||||||
draw_fill_gap(_line_start, _line_end)
|
draw_fill_gap(_line_start, _line_end)
|
||||||
_draw_line = false
|
_draw_line = false
|
||||||
|
|
||||||
|
super.draw_end(pos)
|
||||||
commit_undo()
|
commit_undo()
|
||||||
SteamManager.set_achievement("ACH_ERASE_PIXEL")
|
SteamManager.set_achievement("ACH_ERASE_PIXEL")
|
||||||
cursor_text = ""
|
cursor_text = ""
|
||||||
|
|
|
@ -164,8 +164,8 @@ func draw_move(pos_i: Vector2i) -> void:
|
||||||
|
|
||||||
func draw_end(pos: Vector2i) -> void:
|
func draw_end(pos: Vector2i) -> void:
|
||||||
pos = snap_position(pos)
|
pos = snap_position(pos)
|
||||||
super.draw_end(pos)
|
|
||||||
if _picking_color:
|
if _picking_color:
|
||||||
|
super.draw_end(pos)
|
||||||
return
|
return
|
||||||
|
|
||||||
if _draw_line:
|
if _draw_line:
|
||||||
|
@ -194,6 +194,7 @@ func draw_end(pos: Vector2i) -> void:
|
||||||
draw_tool(v)
|
draw_tool(v)
|
||||||
|
|
||||||
_fill_inside_rect = Rect2i()
|
_fill_inside_rect = Rect2i()
|
||||||
|
super.draw_end(pos)
|
||||||
commit_undo()
|
commit_undo()
|
||||||
cursor_text = ""
|
cursor_text = ""
|
||||||
update_random_image()
|
update_random_image()
|
||||||
|
|
|
@ -291,8 +291,8 @@ func draw_move(pos_i: Vector2i) -> void:
|
||||||
|
|
||||||
func draw_end(pos: Vector2i) -> void:
|
func draw_end(pos: Vector2i) -> void:
|
||||||
pos = snap_position(pos)
|
pos = snap_position(pos)
|
||||||
super.draw_end(pos)
|
|
||||||
if _picking_color:
|
if _picking_color:
|
||||||
|
super.draw_end(pos)
|
||||||
return
|
return
|
||||||
|
|
||||||
if _draw_line:
|
if _draw_line:
|
||||||
|
@ -304,6 +304,7 @@ func draw_end(pos: Vector2i) -> void:
|
||||||
draw_fill_gap(_line_start, _line_end)
|
draw_fill_gap(_line_start, _line_end)
|
||||||
_draw_line = false
|
_draw_line = false
|
||||||
|
|
||||||
|
super.draw_end(pos)
|
||||||
commit_undo()
|
commit_undo()
|
||||||
cursor_text = ""
|
cursor_text = ""
|
||||||
update_random_image()
|
update_random_image()
|
||||||
|
|
Loading…
Reference in a new issue