Skip to content

Commit

Permalink
trivial: Attempt to get rid of a runtime warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Feb 22, 2022
1 parent 96b7959 commit 5062504
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/gx/gtk/vte.d
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ bool checkVTEFeature(TerminalFeature feature) {
// Initialized features if not done yet, can't do it statically
// due to need for GTK to load first
if (!featuresInitialized) {
import vte.c.functions;
import gtk.c.functions : gtk_widget_destroy;

// Force terminal to be loaded if not done already
Terminal terminal = new Terminal();
scope(exit) {terminal.destroy();}
auto terminal = vte_terminal_new ();
scope(exit) {gtk_widget_destroy(terminal);}


// Check if patched events are available
string[] events = ["notification-received", "terminal-screen-changed"];
Expand All @@ -119,7 +123,6 @@ bool checkVTEFeature(TerminalFeature feature) {

import gtkc.Loader: Linker;
import gtkc.paths: LIBRARY;
import vte.c.functions;
string[] failures = Linker.getLoadFailures(LIBRARY_VTE);

foreach(failure; failures) {
Expand Down

0 comments on commit 5062504

Please sign in to comment.