After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 101135 - gtk_viewport_realize() crash if hadjustment is NULL
gtk_viewport_realize() crash if hadjustment is NULL
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Linux
: Low normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 113230 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-12-13 15:12 UTC by Thomas Leonard
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Leonard 2002-12-13 15:12:28 UTC
If gtk_viewport_realize() is called before the hadjustment has been created,
it will segfault. Calling gtk_viewport_set_hadjustment(viewport, NULL)
right after creating it fixes the problem, but it looks like this should
happen automatically...
Comment 1 Owen Taylor 2002-12-13 17:02:47 UTC
Can you provide a test case?

I'm marking priority as Low, since:

 - I don't think anything has changed in a long time here
 - Using a viewport not in a scrolled window is unusual
 - Realize before size allocate is unusual and generally
   discouraged.
Comment 2 Matthias Clasen 2003-05-18 18:55:43 UTC
*** Bug 113230 has been marked as a duplicate of this bug. ***
Comment 3 Owen Taylor 2003-06-06 23:17:54 UTC
Fri Jun  6 16:25:44 2003  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkviewport.c: Many fixes, along with extensive cleanups and
        refactoring of code to reduce duplication; fixes include:

[...]
 
        - gtk_viewport_class_init: Make the hadjustment/vadjustment
properties
        G_PARAM_CONSTRUCT, so that there will always be adjustments, even
        if gtk_viewport_new isn't used (#101135, Thomas Leonard).
 
        - Switch over to encapsulated lazy-creation for hadjustment/
        vadjustment; even with the CONSTRUCT property, we need this after
        destroy.