• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョン8ded41bb98068c5f49cdf0f3a652df041dbf1e4a (tree)
日時2022-01-25 00:13:07
作者Toshi Nagata <alchemist.2005@nift...>
コミッターToshi Nagata

ログメッセージ

The batch mode crashes if Ruby exception was raised. Fixed.

変更サマリ

差分

--- a/wxSources/MyApp.cpp
+++ b/wxSources/MyApp.cpp
@@ -200,12 +200,20 @@ bool MyApp::Initialize(int& argc, wxChar **argv)
200200 {
201201 // Called with a batch mode?
202202 if (argc > 1 && wcscmp(argv[1], L"-b") == 0) {
203+
204+ // Disable any wxLog functionality (otherwise ::exit() may crash)
205+ wxLog::EnableLogging(false);
206+
203207 gUseGUI = 0;
204208 gSuppressConsole = 1;
205209
206210 if (argc > 2 && wcscmp(argv[2], L"-v") == 0)
207211 gSuppressConsole = 0;
208-
212+
213+ // We need these parameters in FindResourcePath(), so we assign them here
214+ this->argc = argc;
215+ this->argv = argv;
216+
209217 static const char fname[] = "startup.rb";
210218 wxString dirname = FindResourcePath();
211219
@@ -246,9 +254,9 @@ bool MyApp::Initialize(int& argc, wxChar **argv)
246254 }
247255 if (status != 0) {
248256 Ruby_showError(status);
249- ::exit(1);
250257 }
251- ::exit(0);
258+ // Force exit
259+ ::exit(status);
252260 } else {
253261 // Call the inherited version
254262 return wxApp::Initialize(argc, argv);
旧リポジトリブラウザで表示