Index: Src/DasherCore/DasherViewSquare.cpp
===================================================================
RCS file: /cvs/gnome/dasher/Src/DasherCore/DasherViewSquare.cpp,v
retrieving revision 1.46.4.1
diff -u -p -r1.46.4.1 DasherViewSquare.cpp
--- Src/DasherCore/DasherViewSquare.cpp	23 Jul 2005 01:05:36 -0000	1.46.4.1
+++ Src/DasherCore/DasherViewSquare.cpp	25 Jul 2005 14:26:12 -0000
@@ -368,8 +368,8 @@ int CDasherViewSquare::RenderNode(const 
 	  
 	  DasherPolygon( x, y, iTotalCount, Color );
 
-	delete x;
-	delete y;
+	  delete[] x;
+	  delete[] y;
 
 	}
 	
@@ -1073,7 +1073,7 @@ void CDasherViewSquare::TapOnDisplay(scr
     mousey = pCoordinates[ 1 ];
   }
 
-  delete pCoordinates;
+  delete[] pCoordinates;
 
   bool autocalibrate=1;
   if (autocalibrate) {
@@ -1163,7 +1163,7 @@ void CDasherViewSquare::DrawMouse(screen
     mousey = pCoordinates[ 1 ];
   }
 
-  delete pCoordinates;  
+  delete[] pCoordinates;  
   myint iDasherX;
   myint iDasherY;
 
@@ -1234,7 +1234,7 @@ void CDasherViewSquare::DrawMouseLine(sc
     mousey = pCoordinates[ 1 ];
   }
 
-  delete pCoordinates;  
+  delete[] pCoordinates;  
 
   myint x[2];
   myint y[2];
Index: Src/DasherCore/libdasher.cc
===================================================================
RCS file: /cvs/gnome/dasher/Src/DasherCore/libdasher.cc,v
retrieving revision 1.18
diff -u -p -r1.18 libdasher.cc
--- Src/DasherCore/libdasher.cc	1 Jul 2005 08:41:02 -0000	1.18
+++ Src/DasherCore/libdasher.cc	25 Jul 2005 14:26:12 -0000
@@ -105,9 +105,9 @@ void handle_colour_scheme(const CCustomC
     blues[i]=Colours->GetBlue(i);
   }
   colour_scheme_callback(numcolours,reds,greens,blues);
-  delete reds;
-  delete greens;
-  delete blues;
+  delete[] reds;
+  delete[] greens;
+  delete[] blues;
 }
 
 void handle_draw_rectangle(int x1, int y1, int x2, int y2, int Color, Opts::ColorSchemes ColorScheme)
Index: Src/Gtk2/canvas.cc
===================================================================
RCS file: /cvs/gnome/dasher/Src/Gtk2/Attic/canvas.cc,v
retrieving revision 1.19.4.4
diff -u -p -r1.19.4.4 canvas.cc
--- Src/Gtk2/canvas.cc	25 Jul 2005 09:39:04 -0000	1.19.4.4
+++ Src/Gtk2/canvas.cc	25 Jul 2005 14:26:12 -0000
@@ -317,11 +317,11 @@ void receive_colour_scheme_callback(int 
 {
 #if WITH_CAIRO
   if (cairo_colours)
-    delete cairo_colours;
+    delete[] cairo_colours;
   cairo_colours = new my_cairo_colour_t[numcolours];
 #else
   if (colours)
-    delete colours;
+    delete[] colours;
   colours = new GdkColor[numcolours];
 #endif
 
Index: Src/Gtk2/dasher.cc
===================================================================
RCS file: /cvs/gnome/dasher/Src/Gtk2/dasher.cc,v
retrieving revision 1.68.4.3
diff -u -p -r1.68.4.3 dasher.cc
--- Src/Gtk2/dasher.cc	24 Jul 2005 21:25:37 -0000	1.68.4.3
+++ Src/Gtk2/dasher.cc	25 Jul 2005 14:26:12 -0000
@@ -367,7 +367,9 @@ generate_preferences(GtkWidget *widget, 
       gchar ugly_path_hack[100];
       sprintf(ugly_path_hack,"%d",i);
       gtk_tree_selection_select_iter(alphselection, &alphiter);
-      gtk_tree_view_set_cursor(GTK_TREE_VIEW(alphabettreeview),gtk_tree_path_new_from_string(ugly_path_hack),NULL,false);
+      GtkTreePath *path = gtk_tree_path_new_from_string(ugly_path_hack);
+      gtk_tree_view_set_cursor(GTK_TREE_VIEW(alphabettreeview),path,NULL,false);
+      gtk_tree_path_free(path);
     }
   }
   
@@ -1541,6 +1543,9 @@ extern "C" void choose_filename() {
     getcwd(cwd,1024);
     filename = g_build_path("/",cwd,tbuffer,NULL);
     gtk_window_set_title(GTK_WINDOW(window), filename);
+
+    free(tbuffer);
+    free(cwd);
   } else {
     gtk_window_set_title(GTK_WINDOW(window), "Dasher");
     if (filename) {
@@ -2274,6 +2279,7 @@ void scan_alphabet_files()
     }
   }
 
+  g_dir_close(directory);
   directory = g_dir_open(user_data_dir,0,NULL);
 
   while((filename=g_dir_read_name(directory))) {
@@ -2281,6 +2287,8 @@ void scan_alphabet_files()
       add_alphabet_filename(filename);
     }
   }
+
+  g_dir_close(directory);
 }
 
 void scan_colour_files()
@@ -2296,6 +2304,7 @@ void scan_colour_files()
     }
   }
 
+  g_dir_close(directory);
   directory = g_dir_open(user_data_dir,0,NULL);
 
   while((filename=g_dir_read_name(directory))) {
@@ -2303,6 +2312,8 @@ void scan_colour_files()
       add_colour_filename(filename);
     }
   }
+
+  g_dir_close(directory);
 }
 
 int alphabet_filter(const gchar* filename)
Index: Src/Gtk2/edit.cc
===================================================================
RCS file: /cvs/gnome/dasher/Src/Gtk2/edit.cc,v
retrieving revision 1.17
diff -u -p -r1.17 edit.cc
--- Src/Gtk2/edit.cc	22 Apr 2005 15:13:49 -0000	1.17
+++ Src/Gtk2/edit.cc	25 Jul 2005 14:26:12 -0000
@@ -593,7 +593,9 @@ void gtk2_get_new_context_callback( std:
 
   gtk_text_iter_backward_chars(start, max);
 
-  str = std::string( gtk_text_buffer_get_text( the_text_buffer, start, end, FALSE ) );
+  char *s = gtk_text_buffer_get_text( the_text_buffer, start, end, FALSE );
+  str = std::string(s);
+  g_free (s);
 
   delete start;
   delete end;  

