Skip to content

Commit

Permalink
Fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Feb 16, 2024
1 parent 0596cbf commit 2cfcc12
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Sources/nCine/MainApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,20 @@ namespace nCine
appEventHandler_ = createAppEventHandler();

// Only `OnPreInit()` can modify the application configuration
if (argc > 1) {
#if defined(DEATH_TARGET_WINDOWS)
appCfg_.argv_ = Array<String>(argc - 1);
for (std::int32_t i = 1; i < argc; i++) {
appCfg_.argv_[i - 1] = Utf8::FromUtf16(argv[i]);
}
appCfg_.argv_ = Array<String>(argc - 1);
for (std::int32_t i = 1; i < argc; i++) {
appCfg_.argv_[i - 1] = Utf8::FromUtf16(argv[i]);
}
#else
appCfg_.argv_ = Array<StringView>(argc - 1);
for (std::int32_t i = 1; i < argc; i++) {
appCfg_.argv_[i - 1] = argv[i];
}
appCfg_.argv_ = Array<StringView>(argc - 1);
for (std::int32_t i = 1; i < argc; i++) {
appCfg_.argv_[i - 1] = argv[i];
}
#endif
}

appEventHandler_->OnPreInit(appCfg_);
LOGI("IAppEventHandler::OnPreInit() invoked");

Expand Down

0 comments on commit 2cfcc12

Please sign in to comment.