changeset 231:a3775f5b877f

Only free current_file when we have a new file selected to show.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 05 Feb 2003 07:11:37 +0000
parents 15810221d4ea
children 4e91b3c42e05
files dwtest.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dwtest.c	Wed Feb 05 07:00:52 2003 +0000
+++ b/dwtest.c	Wed Feb 05 07:11:37 2003 +0000
@@ -137,13 +137,13 @@
 int DWSIGNAL browse_callback(HWND window, void *data)
 {
 	char *tmp;
-	if ( current_file )
-	{
-		dw_free( current_file );
-	}
 	tmp = dw_file_browse("test string", NULL, "c", DW_FILE_OPEN );
 	if ( tmp )
 	{
+		if ( current_file )
+		{
+			dw_free( current_file );
+		}
 		current_file = tmp;
 		dw_window_set_text( entryfield, current_file );
 		read_file();