diff options
author | Doug Geiger <doug.geiger@bioradiation.net> | 2015-04-21 21:36:34 -0400 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2015-04-22 17:49:21 +0200 |
commit | 839b933dd40f876a3a85351462575bac46ffd441 (patch) | |
tree | 88c7e8f9de2a7171d04ed5f4aebc77879fd301cd /grc/scripts | |
parent | d8a491fde1f29e10d77f536ea1234ee96089202a (diff) |
grc: Add check for GTK initialization
Ensure GTK can be initialized before application start-up (e.g. if X11 forwarding is not enabled on an SSH connection) to avoid a fatal error (e.g. segfault)
Diffstat (limited to 'grc/scripts')
-rwxr-xr-x | grc/scripts/gnuradio-companion | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion index 7a407eaaf8..b8b960a91e 100755 --- a/grc/scripts/gnuradio-companion +++ b/grc/scripts/gnuradio-companion @@ -55,6 +55,14 @@ def show_gtk_error_dialog(title, message): d.run() +def check_gtk_init(): + try: + gtk.init_check() + except RuntimeError: + print 'GTK initialization failed - bailing' + exit(-1) + + def check_gnuradio_import(): try: from gnuradio import gr @@ -108,6 +116,7 @@ def main(): if __name__ == '__main__': + check_gtk_init() check_gnuradio_import() ensure_blocks_path() main() |