gtksheet - gtk+-2.2.4
- From: Joseph Turner <joeman leederville net>
- To: gtk-app-devel-list gnome org
- Subject: gtksheet - gtk+-2.2.4
- Date: Mon, 2 Feb 2004 23:23:19 +0800
Hello,
HAven't had any replies since I started posting my questions about
killing gtksheets (destroy).
I think now that there are some memory leaks in gtksheet inside gtkextra-2.
e.g. I implement the following ....
#include <gtk/gtk.h>
#include <gtkextra/gtksheet.h>
static GtkContainerClass *parent_class = NULL;
void
quit ()
{
gtk_main_quit();
}
void my_destroy( GtkWidget *child )
{
g_print("my_destroy: destroying a %s\n", G_OBJECT_TYPE_NAME (child));
gtk_widget_destroy (child);
}
int close_it(GtkWidget *but, GtkWidget *shet)
{
if (GTK_IS_SHEET(shet) && GTK_IS_WIDGET(shet))
{
gtk_sheet_unclip_range(GTK_SHEET(shet));
g_print("I would destroy it, but I won't\n");
// gtk_widget_destroy(shet);
}
}
int main ( int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *sheet;
GtkWidget *vbox;
GtkTextBuffer *buffer;
GtkWidget *button;
gtk_init (&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(GTK_WIDGET(window), 900, 600);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (quit), NULL);
button = gtk_button_new();
vbox = gtk_vbox_new(TRUE, 1);
gtk_container_add(GTK_CONTAINER(window), vbox);
sheet=gtk_sheet_new(3,11,"Edit table");
gtk_sheet_set_autoresize(GTK_SHEET(sheet), TRUE);
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(vbox), sheet, FALSE, TRUE, 0);
g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (close_it), sheet);
gtk_widget_show_all(window);
gtk_main();
return(0);
When I incomment the line in close_it,
and I keep clicking the button, it seg fault.
(Maybe this post is not more appropriate in the gtk-devel list)
Cheers
Joe
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]