Bug 5945 - Context.getFontOptions() seg faults
Summary: Context.getFontOptions() seg faults
Status: RESOLVED FIXED
Alias: None
Product: cairo-java
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Igor Foox
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-19 11:21 UTC by Remy Suen
Modified: 2006-03-23 08:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to initialize the pointer before passing it to the function. (698 bytes, patch)
2006-02-19 11:32 UTC, Remy Suen
Details | Splinter Review

Description Remy Suen 2006-02-19 11:21:09 UTC
The code below causes a segfault in the application.

ImageSurface surface = new ImageSurface(Format.ARGB32, 300, 200);
Context context = new Context(surface);
context.getFontOptions();
Comment 1 Remy Suen 2006-02-19 11:32:06 UTC
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.
Comment 2 Dan Williams 2006-03-24 03:34:58 UTC
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.