Fix crash in scripting plugin on reshow

closes #56
9 jobs for scripting_plugin_crash in 77 minutes and 33 seconds
Status Name Job ID Coverage
  Test
passed clang-c++11-Qt4 #6130
Linux MultiThreads

00:07:26

passed clang-c++11-Qt5 #6134
Linux MultiThreads

00:08:50

passed clang-c++98-Qt4 #6132
Linux MultiThreads

00:06:03

passed clang-c++98-Qt5 #6136
Linux MultiThreads

00:07:00

passed cppcheck #6137
Linux MultiThreads

00:33:47

passed gcc-c++11-Qt4 #6129
Linux

00:03:37

passed gcc-c++11-Qt5 #6133
Linux

00:04:12

passed gcc-c++98-Qt4 #6131
Linux

00:02:35

passed gcc-c++98-Qt5 #6135
Linux

00:03:59