comparison dwtest.c @ 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 4166c18586e5
children 4e91b3c42e05
comparison
equal deleted inserted replaced
230:15810221d4ea 231:a3775f5b877f
135 } 135 }
136 136
137 int DWSIGNAL browse_callback(HWND window, void *data) 137 int DWSIGNAL browse_callback(HWND window, void *data)
138 { 138 {
139 char *tmp; 139 char *tmp;
140 if ( current_file )
141 {
142 dw_free( current_file );
143 }
144 tmp = dw_file_browse("test string", NULL, "c", DW_FILE_OPEN ); 140 tmp = dw_file_browse("test string", NULL, "c", DW_FILE_OPEN );
145 if ( tmp ) 141 if ( tmp )
146 { 142 {
143 if ( current_file )
144 {
145 dw_free( current_file );
146 }
147 current_file = tmp; 147 current_file = tmp;
148 dw_window_set_text( entryfield, current_file ); 148 dw_window_set_text( entryfield, current_file );
149 read_file(); 149 read_file();
150 draw_file(0,0); 150 draw_file(0,0);
151 } 151 }