The code below causes a segfault in the application. ImageSurface surface = new ImageSurface(Format.ARGB32, 300, 200); Context context = new Context(surface); context.getFontOptions();
Created attachment 4670 [details] [review] Patch to initialize the pointer before passing it to the function. If you were to change the application to something like: ImageSurface surface = new ImageSurface(Format.ARGB32, 300, 200); Context context = new Context(surface); FontOptions options = new FontOptions(); context.setFontOptions(options); FontOptions get = context.getFontOptions(); // returns true // we are calling a function from the Cairo API here options.equal(get); // returns false // we are calling the Java method we have defined in org.gnu.glib.Struct here options.equals(get); I don't know if the second part returning false is okay or not. Even if we were to create a static factory method like we do in a multitude of the classes we have in the gtk+ bindings, the handles would still be different since we're instantiating a new cairo_font_options_t every single time. Despite the fact that we're using a GC-based language, this still worries me a bit.
Fixed as part of commit for http://bugzilla.gnome.org/show_bug.cgi?id=335300
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.