mirror of
https://github.com/jtheoof/swappy.git
synced 2024-09-11 14:55:49 +03:00
fix(paint): fix memory leak for brush paints
This commit is contained in:
parent
02bc464564
commit
aed2bfe294
@ -10,6 +10,7 @@ void paint_free(gpointer data) {
|
|||||||
switch (paint->type) {
|
switch (paint->type) {
|
||||||
case SWAPPY_PAINT_MODE_BRUSH:
|
case SWAPPY_PAINT_MODE_BRUSH:
|
||||||
g_list_free_full(paint->content.brush.points, g_free);
|
g_list_free_full(paint->content.brush.points, g_free);
|
||||||
|
g_free(paint);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_free(paint);
|
g_free(paint);
|
||||||
@ -106,9 +107,10 @@ void paint_update_temporary(struct swappy_state *state, double x, double y) {
|
|||||||
case SWAPPY_PAINT_MODE_RECTANGLE:
|
case SWAPPY_PAINT_MODE_RECTANGLE:
|
||||||
case SWAPPY_PAINT_MODE_ELLIPSE:
|
case SWAPPY_PAINT_MODE_ELLIPSE:
|
||||||
case SWAPPY_PAINT_MODE_ARROW:
|
case SWAPPY_PAINT_MODE_ARROW:
|
||||||
|
paint->can_draw = true; // all set
|
||||||
|
|
||||||
paint->content.shape.to.x = x;
|
paint->content.shape.to.x = x;
|
||||||
paint->content.shape.to.y = y;
|
paint->content.shape.to.y = y;
|
||||||
paint->can_draw = true; // all set
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_info("unable to update temporary paint: %d", paint->type);
|
g_info("unable to update temporary paint: %d", paint->type);
|
||||||
|
Loading…
Reference in New Issue
Block a user