Make sure we don't try to do this if we are marked deleted

2001-08-23  Bradford Hovinen  <hovinen@ximian.com>

	* config-log.c (do_unload): Make sure we don't try to do this if
	we are marked deleted
	(config_log_delete): Call do_unload to eliminate memory leaks

	* location.c (location_delete): Set the deleted flag

	* config-log.c (dump_log): Don't try to dump the log if we are
	deleted

	* location.c (save_metadata): Don't try to save metadata if we are
	deleted
This commit is contained in:
Bradford Hovinen 2001-08-23 20:09:21 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 0ddf82fefe
commit 286cb3899a
3 changed files with 26 additions and 6 deletions

View file

@ -282,12 +282,11 @@ config_log_delete (ConfigLog *config_log)
g_return_if_fail (config_log != NULL);
g_return_if_fail (IS_CONFIG_LOG (config_log));
if (config_log->p->file_stream != NULL)
fclose (config_log->p->file_stream);
if (config_log->p->filename != NULL)
unlink (config_log->p->filename);
do_unload (config_log, FALSE);
config_log->p->deleted = TRUE;
gtk_object_destroy (GTK_OBJECT (config_log));
}
@ -890,6 +889,8 @@ do_unload (ConfigLog *config_log, gboolean write_log)
g_return_if_fail (config_log != NULL);
g_return_if_fail (IS_CONFIG_LOG (config_log));
if (config_log->p->deleted) return;
if (write_log) dump_log (config_log);
if (config_log->p->file_stream) {
@ -976,6 +977,8 @@ dump_log (ConfigLog *config_log)
g_return_if_fail (IS_LOCATION (config_log->p->location));
g_return_if_fail (location_get_path (config_log->p->location) != NULL);
if (config_log->p->deleted) return;
filename_out = g_concat_dir_and_file (location_get_path
(config_log->p->location),
"config.log.out");