(delete_surrounding_text): Clear cache if necessary.
authorhanda <handa>
Fri, 11 Nov 2005 01:36:46 +0000 (01:36 +0000)
committerhanda <handa>
Fri, 11 Nov 2005 01:36:46 +0000 (01:36 +0000)
src/input.c

index 1e47e03..83891b1 100644 (file)
@@ -488,9 +488,15 @@ get_surrounding_text (MInputContext *ic, int len)
 static void
 delete_surrounding_text (MInputContext *ic, int pos)
 {
+  MInputContextInfo *ic_info = (MInputContextInfo *) ic->info;
+
   mplist_push (ic->plist, Minteger, (void *) pos);
   minput__callback (ic, Minput_delete_surrounding_text);
   mplist_pop (ic->plist);
+  if (pos < 0)
+    M17N_OBJECT_UNREF (ic_info->preceding_text);
+  else if (pos > 0)
+    M17N_OBJECT_UNREF (ic_info->following_text);
 }
 
 static int