Skip to content

Commit 26dbe02

Browse files
yvtbilelmoussaoui
authored andcommitted
gtk: Do not assume parent impl of GLArea.create_context returns non-null
1 parent b5abe42 commit 26dbe02

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

gtk4/src/subclass/gl_area.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ pub trait GLAreaImplExt: GLAreaImpl {
3030
let data = Self::type_data();
3131
let parent_class = data.as_ref().parent_class() as *mut ffi::GtkGLAreaClass;
3232
if let Some(f) = (*parent_class).create_context {
33-
return Some(from_glib_none(f(self
34-
.obj()
35-
.unsafe_cast_ref::<GLArea>()
36-
.to_glib_none()
37-
.0)));
33+
return from_glib_none(f(self.obj().unsafe_cast_ref::<GLArea>().to_glib_none().0));
3834
};
3935
None
4036
}

0 commit comments

Comments
 (0)