mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-22 15:39:52 +00:00
Fixed a memory leak.
This commit is contained in:
parent
b797cd91b7
commit
a9ec8b61f0
@ -1,5 +1,5 @@
|
|||||||
/* ASE - Allegro Sprite Editor
|
/* ASE - Allegro Sprite Editor
|
||||||
* Copyright (C) 2001-2005, 2007, 2008 David A. Capello
|
* Copyright (C) 2001-2008 David A. Capello
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -155,14 +155,6 @@ static bool color_bar_msg_proc (JWidget widget, JMessage msg)
|
|||||||
|
|
||||||
switch (msg->type) {
|
switch (msg->type) {
|
||||||
|
|
||||||
case JM_DESTROY:
|
|
||||||
jfree (color_bar);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case JM_REQSIZE:
|
|
||||||
msg->reqsize.w = msg->reqsize.h = 16;
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case JM_OPEN: {
|
case JM_OPEN: {
|
||||||
int ncolor = get_config_int ("ColorBar", "NColors", color_bar->ncolor);
|
int ncolor = get_config_int ("ColorBar", "NColors", color_bar->ncolor);
|
||||||
char buf[256], def[256];
|
char buf[256], def[256];
|
||||||
@ -188,7 +180,7 @@ static bool color_bar_msg_proc (JWidget widget, JMessage msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case JM_CLOSE: {
|
case JM_DESTROY: {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@ -201,9 +193,17 @@ static bool color_bar_msg_proc (JWidget widget, JMessage msg)
|
|||||||
set_config_string("ColorBar", buf, color_bar->color[c]);
|
set_config_string("ColorBar", buf, color_bar->color[c]);
|
||||||
jfree(color_bar->color[c]);
|
jfree(color_bar->color[c]);
|
||||||
}
|
}
|
||||||
|
for (; c<COLOR_BAR_COLORS; c++)
|
||||||
|
jfree(color_bar->color[c]);
|
||||||
|
|
||||||
|
jfree(color_bar);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case JM_REQSIZE:
|
||||||
|
msg->reqsize.w = msg->reqsize.h = 16;
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
case JM_DRAW: {
|
case JM_DRAW: {
|
||||||
int imgtype = app_get_current_image_type();
|
int imgtype = app_get_current_image_type();
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user