Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit ba93ca8

Browse files
Add missing GTK initialization check
1 parent 50e5e7f commit ba93ca8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gtk/src/subclass/scrolled_window.rs

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ unsafe impl<T: ScrolledWindowImpl> IsSubclassable<T> for ScrolledWindow {
7171
fn class_init(class: &mut ::glib::Class<Self>) {
7272
Self::parent_class_init::<T>(class);
7373

74+
if !crate::rt::is_initialized() {
75+
panic!("GTK has to be initialized first");
76+
}
77+
7478
let klass = class.as_mut();
7579
klass.move_focus_out = Some(window_move_focus_out::<T>);
7680
klass.scroll_child = Some(window_scroll_child::<T>);

0 commit comments

Comments
 (0)