Skip to content

Commit dce4704

Browse files
committed
fix: Allocate new for TaskNetworkTimeoutSeconds.
1 parent 443711e commit dce4704

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/src/eos_helpers.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ namespace pew::eos
367367

368368
if (platform_config.task_network_timeout_seconds > 0)
369369
{
370-
double task_network_timeout_seconds_dbl = platform_config.task_network_timeout_seconds;
371-
platform_options.TaskNetworkTimeoutSeconds = &task_network_timeout_seconds_dbl;
370+
// Make sure this gets deleted
371+
platform_options.TaskNetworkTimeoutSeconds = new double(platform_config.task_network_timeout_seconds);
372372
}
373373

374374
platform_options.RTCOptions = platform_config.get_platform_rtc_options().get();
@@ -389,6 +389,9 @@ namespace pew::eos
389389

390390
static const auto create_options = get_create_options(*platform_config, *product_config);
391391

392+
// delete the one allocation
393+
delete create_options.TaskNetworkTimeoutSeconds;
394+
392395
return create_options;
393396
}
394397

@@ -428,5 +431,8 @@ namespace pew::eos
428431
{
429432
logging::log_inform("Successfully created the EOS SDK Platform.");
430433
}
434+
435+
// Delete the one allocation
436+
delete platform_options.TaskNetworkTimeoutSeconds;
431437
}
432438
}

0 commit comments

Comments
 (0)