Re: Equivalent of the gtk g_object_ref/unref functions in gtkmm?
- From: "Paul Davis" <pjdavis engineering uiowa edu>
- To: "Jef Driesen" <jefdriesen hotmail com>
- Cc: Murray Cumming <murrayc murrayc com>, gtkmm-list gnome org
- Subject: Re: Equivalent of the gtk g_object_ref/unref functions in gtkmm?
- Date: Tue, 27 Mar 2007 05:25:52 -0500
On 3/27/07, Jef Driesen <jefdriesen hotmail com> wrote:
[Repost, forgot the send a copy to the list]
Paul Davis wrote:
> On 3/26/07, Jef Driesen <jefdriesen hotmail com> wrote:
>> Murray Cumming wrote:
>>> On Mon, 2007-03-26 at 16:30 +0200, Jef Driesen wrote:
>>>> Jonathon Jongsma wrote:
>>>>> On 3/26/07, Jef Driesen <jefdriesen hotmail com> wrote:
>>>>>> The application works fine, but closing the main window results in a
>>>>>> segmentation fault (core dump). As far as I can tell (from a gdb
>>>>>> backtrace) the crash is not in my own code, but somewhere inside the
>>>>>> gtk(mm) library.
>>>>> Could you provide the backtrace? that might be helpful information.
>>>> Sometimes I don't get the segmentation fault, but only a large number of
>>>> errors. See attachment for both the backtrace and the errors.
>>> If you get glib errors, try debuggin with --g-fatal-warnings, or with a
>>> breakpoing on g_log. Then you'll get a backtrace at the relevant point.
>> Backtrace attached, although it doesn't seem to provide much more
>> information to me.
>>
>>> valgrind's memcheck is also incredibly helpful. Trust us on this. You
>>> won't regret trying it.
>> I get lots of errors from valgrind, but I also get them for the trivial
>> program
>>
>> int main (int argc, char *argv[])
>> {
>> Gtk::Main kit(argc, argv);
>> Gtk::Window window;
>> kit.run(window);
>> return 0;
>> }
>>
>> But to be honest I never used valgrind before, so I could be using it wrong.
>
> By chance, does your vbox3 that you pull out of glade contain a
> Gtk::Menu? I seem to remember reading somewhere about a problem
> pulling the menu out of glade but not the window that contains it.
>
> Although, I can't recall this ever happening to me...
That could be the problem, because the vbox contains an (unused)
menubar. Removing that menubar from the glade file fixes the problem.
> You might try having your Application class have the top level window
> as a member variable that gets pulled out of the glade file instead of
> inheriting from Gtk::Window. You should be able to test that in about
> 5 minutes and see if it makes a difference.
This also fixes the crash.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
First off, can you list the version numbers for:
gtk, gtkmm, glade, and libglademm
You should be able to check them with:
$ pkg-config --modversion gtk+-2.0
$ pkg-config --modversion gtkmm-2.4
$ pkg-config --modversion libglade-2.0
$ pkg-config --modversion libgaldemm-2.4
Jeff, if you have a chance, could you post the least amount of
compilable code that generates this error, along with the glade file.
That'll help making a simple test case to try and isolate the problem.
I did some looking around on bugzilla, but I didn't see anything
related at first glance. I was pretty sure I read an email not too
long ago about a problem similar to this, then again, I could be
crazy.
Paul Davis
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]