From ba93ca82c66b572b677ce120008405af493b410c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 22 Apr 2022 16:47:49 +0200 Subject: [PATCH] Add missing GTK initialization check --- gtk/src/subclass/scrolled_window.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/src/subclass/scrolled_window.rs b/gtk/src/subclass/scrolled_window.rs index 1e94a362a778..385e542a4cfa 100644 --- a/gtk/src/subclass/scrolled_window.rs +++ b/gtk/src/subclass/scrolled_window.rs @@ -71,6 +71,10 @@ unsafe impl IsSubclassable for ScrolledWindow { fn class_init(class: &mut ::glib::Class) { Self::parent_class_init::(class); + if !crate::rt::is_initialized() { + panic!("GTK has to be initialized first"); + } + let klass = class.as_mut(); klass.move_focus_out = Some(window_move_focus_out::); klass.scroll_child = Some(window_scroll_child::);