Index: record.c
===================================================================
RCS file: /cvs/record/record.c,v
retrieving revision 1.3
diff -u -p -r1.3 record.c
--- record.c	28 Jul 2005 22:08:24 -0000	1.3
+++ record.c	25 Apr 2006 08:54:04 -0000
@@ -156,8 +156,16 @@ int main (int argc, char *argv[])
   int init_error;
   char *app_name = NULL;
   char *file = NULL;
+  struct rlimit resource_limit;
   struct sigaction new_action, old_action;
   
+  /* generate core dump on seg-fault */
+  resource_limit.rlim_cur =
+    resource_limit.rlim_max = RLIM_INFINITY;
+  if (setrlimit (RLIMIT_CORE, &resource_limit) != 0) {
+    perror ("setrlimit");
+  }
+
   /* Set up the structure to specify the new action. */
   new_action.sa_handler = safe_exit;
   sigemptyset (&new_action.sa_mask);
Index: register-events.c
===================================================================
RCS file: /cvs/record/register-events.c,v
retrieving revision 1.6
diff -u -p -r1.6 register-events.c
--- register-events.c	1 Aug 2005 22:52:53 -0000	1.6
+++ register-events.c	25 Apr 2006 08:54:04 -0000
@@ -163,11 +163,12 @@ void text_changed_cb (const AccessibleEv
     {
       text = Accessible_getText (event->source);
       txt = AccessibleText_getText (text, 0, -1);
-      if (txt)
+      if (txt) {
         set_text = strdup (txt);
+	SPI_freeString (txt);
+      }
     }
 
-  SPI_freeString (txt);
   Accessible_unref (text);
   SPI_freeString (role);
 }
@@ -199,9 +200,11 @@ void text_caret_moved_cb (const Accessib
 	}	
 	
 	text_selection_flag = 1;
+	if (selected_text)
+	  old_selected_text = g_strdup_printf("%s", selected_text);
       }
-    old_selected_text = g_strdup_printf("%s", selected_text);
     SPI_freeString (role);
+    Accessible_unref (text);
 }
 
 void text_selection_changed_cb (const AccessibleEvent *event, void *user_data)
