libgimp/gimptile.c (gimp_tile_put) added missing calls to wire_destroy().

2005-01-15  Sven Neumann  <sven@gimp.org>

	* libgimp/gimptile.c (gimp_tile_put)
	* libgimp/gimp.c (gimp_loop) (gimp_read_expect_msg): added missing
	calls to wire_destroy(). Plugs memory leaks in the wire protocol.
This commit is contained in:
Sven Neumann 2005-01-15 12:09:25 +00:00 committed by Sven Neumann
parent c40f654fb9
commit 022b3532f8
3 changed files with 31 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2005-01-15 Sven Neumann <sven@gimp.org>
* libgimp/gimptile.c (gimp_tile_put)
* libgimp/gimp.c (gimp_loop) (gimp_read_expect_msg): added missing
calls to wire_destroy(). Plugs memory leaks in the wire protocol.
2005-01-15 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpprotocol.c: formatting.

View file

@ -890,18 +890,19 @@ gimp_read_expect_msg (WireMessage *msg,
if (! wire_read_msg (_readchannel, msg, NULL))
gimp_quit ();
if (msg->type != type)
{
if (msg->type == GP_TEMP_PROC_RUN || msg->type == GP_QUIT)
{
gimp_process_message (msg);
continue;
}
else
g_error ("unexpected message: %d", msg->type);
}
if (msg->type == type)
return; /* up to the caller to call wire_destroy() */
if (msg->type == GP_TEMP_PROC_RUN || msg->type == GP_QUIT)
{
gimp_process_message (msg);
}
else
break;
{
g_error ("unexpected message: %d", msg->type);
}
wire_destroy (msg);
}
}
@ -941,6 +942,7 @@ gimp_run_procedure2 (const gchar *name,
gimp_read_expect_msg (&msg, GP_PROC_RETURN);
proc_return = msg.data;
*n_return_vals = proc_return->nparams;
return_vals = (GimpParam *) proc_return->params;
@ -1601,32 +1603,42 @@ gimp_loop (void)
switch (msg.type)
{
case GP_QUIT:
wire_destroy (&msg);
gimp_close ();
return;
case GP_CONFIG:
gimp_config (msg.data);
break;
case GP_TILE_REQ:
case GP_TILE_ACK:
case GP_TILE_DATA:
g_warning ("unexpected tile message received (should not happen)");
break;
case GP_PROC_RUN:
gimp_proc_run (msg.data);
wire_destroy (&msg);
gimp_close ();
return;
case GP_PROC_RETURN:
g_warning ("unexpected proc return message received (should not happen)");
break;
case GP_TEMP_PROC_RUN:
g_warning ("unexpected temp proc run message received (should not happen");
break;
case GP_TEMP_PROC_RETURN:
g_warning ("unexpected temp proc return message received (should not happen");
break;
case GP_PROC_INSTALL:
g_warning ("unexpected proc install message received (should not happen)");
break;
case GP_HAS_INIT:
g_warning ("unexpected has init message received (should not happen)");
break;

View file

@ -264,8 +264,9 @@ gimp_tile_put (GimpTile *tile)
if (! gp_tile_data_write (_writechannel, &tile_data, NULL))
gimp_quit ();
gimp_read_expect_msg (&msg, GP_TILE_ACK);
wire_destroy (&msg);
gimp_read_expect_msg (&msg, GP_TILE_ACK);
wire_destroy (&msg);
}