unref-ing fonts



This is really more of an X question than a GTK question, but...

What are the rules for gdk_font_unref-ing fonts?

I am trying to change the font part of a GC by doing something like:

GdkGC* gc = gdk_gc_new(GTK_WIDGET(my_object)->window);
gdk_font_unref( ((GdkGCValues*)gc)->font );
((GdkGCValues*)gc)->font = gdk_font_load("my-favorite-font");

However, I get a sigsegv at the gdk_font_unref().  If I omit this call,
it seems like I would be leaking memory.  Or is there some problem
with unref-ing the font that comes by default with a newly constructed GC?

(My Gtk_Canvas widget sprouted a new bug moments after I made it
publicly available...)

-Jon Trowbridge
 EMC Capital Management, Inc.



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