Re: [gtk-list] Unsolvable bug ...



Hi!

2 remarks:
1: It looks to me as if you are destroying and creating too often, you
might want to think of other solutions like using on window for
searching and one for results or one for both at once (MHO from your
description, don't take that too serious)
2: Whenever I have a bug like yours, it is a bad malloc, realloc, free
or the like. I have no receipt yet for finding them, but the number of
such bugs is reduced by some large factor using the g_malloc, g_new,
g_free, etc., as well as the string handling function which are prone to
memory errors, too. I actually find most of the bugs in older programs
of mine by replacing all functions concerning memory by those of glib.
Another possibility is that you accidentally refer to a widget that is
destroyed, when it's parent gets destroyed.

Good luck,
Roland Bock

Maki Todoriki wrote:
> 
> Hello,
> 
> I have a bug I can't solve. My program crash desperately.
> 
> I have tried to re-think the approach, and the code, but ...
> 
> I just had an idea, maybe what I want to do is basically wrong : I want
> to modify the content of a part of a windows.
> 
> It's a search area, so the user can define the fields,.... then click on
> the search button. At this time I do a gtk_widget_destroy of a vbox
> inside the window, and put the result of the research instead.
> 
> But I want my user to be able to refine the search, so once again I
> destroy the box and put the search widget inside.
> 
> For example  I have two vbox :
> 
> searchbox and searchcontainer.
> 
> I use the searchcontainer to put the search widget and the result. I do
> a
> 
> gtk_widget_destroy(searchcontainer)
> 
> when the user click on something, then I reconstruct the
> searchcontainer, with the precedent widget. Then I make a
> 
> searchcontainer=create_search_canvas(....);
> 
> gtk_container_add(GTK_CONTAINER(searchbox),searchcontainer);
> 
> But this seems to destabilize the code.
> 
> Do you think the pilosophy is wrong, and why ? What should I use instead
> ?
> 
> This is quite urgent, so please forgive me if I ask you to help me
> resolve a bug of mine ...
> 
> Thank you
> 
> P.S. I'm coding a MySQL interface with  Gtk+, if it may help !
> 
> Bruno Mairlot
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]