comparison src/scrollbar-x.c @ 5178:97eb4942aec8

merge
author Ben Wing <ben@xemacs.org>
date Mon, 29 Mar 2010 21:28:13 -0500
parents 5ddbab03b0e6
children 308d34e9f07d
comparison
equal deleted inserted replaced
5177:b785049378e3 5178:97eb4942aec8
74 x_free_scrollbar_instance (struct scrollbar_instance *instance) 74 x_free_scrollbar_instance (struct scrollbar_instance *instance)
75 { 75 {
76 if (instance->scrollbar_data) 76 if (instance->scrollbar_data)
77 { 77 {
78 if (SCROLLBAR_X_NAME (instance)) 78 if (SCROLLBAR_X_NAME (instance))
79 xfree (SCROLLBAR_X_NAME (instance)); 79 {
80 xfree (SCROLLBAR_X_NAME (instance));
81 SCROLLBAR_X_NAME (instance) = 0;
82 }
80 83
81 if (SCROLLBAR_X_WIDGET (instance)) 84 if (SCROLLBAR_X_WIDGET (instance))
82 { 85 {
83 if (XtIsManaged (SCROLLBAR_X_WIDGET (instance))) 86 if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
84 XtUnmanageChild (SCROLLBAR_X_WIDGET (instance)); 87 XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
85 88
86 lw_destroy_all_widgets (SCROLLBAR_X_ID (instance)); 89 lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
87 } 90 }
88 91
89 xfree (instance->scrollbar_data); 92 xfree (instance->scrollbar_data);
93 instance->scrollbar_data = 0;
90 } 94 }
91 } 95 }
92 96
93 /* A device method. */ 97 /* A device method. */
94 static void 98 static void
692 XWINDOW_MIRROR (f->root_mirror), 0, (Window) NULL); 696 XWINDOW_MIRROR (f->root_mirror), 0, (Window) NULL);
693 } 697 }
694 698
695 #ifdef MEMORY_USAGE_STATS 699 #ifdef MEMORY_USAGE_STATS
696 700
697 static int 701 static Bytecount
698 x_compute_scrollbar_instance_usage (struct device *UNUSED (d), 702 x_compute_scrollbar_instance_usage (struct device *UNUSED (d),
699 struct scrollbar_instance *inst, 703 struct scrollbar_instance *inst,
700 struct overhead_stats *ovstats) 704 struct usage_stats *ustats)
701 { 705 {
702 int total = 0; 706 Bytecount total = 0;
703 707 struct x_scrollbar_data *data =
704 while (inst) 708 (struct x_scrollbar_data *) inst->scrollbar_data;
705 { 709
706 struct x_scrollbar_data *data = 710 total += malloced_storage_size (data, sizeof (*data), ustats);
707 (struct x_scrollbar_data *) inst->scrollbar_data; 711 total += malloced_storage_size (data->name, 1 + strlen (data->name),
708 712 ustats);
709 total += malloced_storage_size (data, sizeof (*data), ovstats);
710 total += malloced_storage_size (data->name, 1 + strlen (data->name),
711 ovstats);
712 inst = inst->next;
713 }
714 713
715 return total; 714 return total;
716 } 715 }
717 716
718 #endif /* MEMORY_USAGE_STATS */ 717 #endif /* MEMORY_USAGE_STATS */