Merge from emacs-23; up to 2010-05-26T14:19:15Z!monnier@iro.umontreal.ca.
[bpt/emacs.git] / lwlib / lwlib-Xm.c
index 1116a6a..059cf10 100644 (file)
@@ -1,8 +1,7 @@
 /* The lwlib interface to Motif widgets.
-   Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007, 2008, 2009, 2010
-                 Free Software Foundation, Inc.
-   Copyright (C) 1992 Lucid, Inc.
+
+Copyright (C) 1994-1997, 1999-2011  Free Software Foundation, Inc.
+Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -174,7 +173,7 @@ make_destroyed_instance (char* name,
                          Boolean pop_up_p)
 {
   destroyed_instance* instance =
-    (destroyed_instance*)malloc (sizeof (destroyed_instance));
+    (destroyed_instance*) xmalloc (sizeof (destroyed_instance));
   instance->name = safe_strdup (name);
   instance->type = safe_strdup (type);
   instance->widget = widget;
@@ -800,7 +799,7 @@ xm_update_menu (widget_instance* instance,
 
   /* Now replace from scratch all the buttons after the last
      place that the top-level structure changed.  */
-  if (val->contents->change == STRUCTURAL_CHANGE)
+  if (val->contents && val->contents->change == STRUCTURAL_CHANGE)
     {
       destroy_all_children (widget, num_children_to_keep);
       make_menu_in_widget (instance, widget, val->contents,
@@ -1958,5 +1957,3 @@ xm_manage_resizing (Widget w, Boolean flag)
   XtVaSetValues (w, XtNallowShellResize, flag, NULL);
 }
 
-/* arch-tag: 73976f64-73b2-4600-aa13-d9ede20ee965
-   (do not change this comment) */