Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit c2aaf9f

Browse files
committed
fix segfault due to eager copying
1 parent b0e5c5c commit c2aaf9f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

spatialos-sdk/src/worker/logging.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ impl LogsinkParameters {
216216
pub fn to_worker_sdk(&self) -> (Worker_LogsinkParameters, Vec<ReleaseCallbackHandle>) {
217217
let rotating_logfile_parameters = match self.logsink_type {
218218
LogsinkType::RotatingFile(ref params) => params.to_worker_sdk(),
219-
_ => Default::default(),
219+
_ => Worker_RotatingLogFileParameters {
220+
log_prefix: WORKER_DEFAULTS_LOG_PREFIX.as_ptr() as *const i8,
221+
max_log_files: 0,
222+
max_log_file_size_bytes: 0,
223+
},
220224
};
221225

222226
let (log_callback_parameters, release_log_callback_handle) = match self.logsink_type {

spatialos-sdk/src/worker/parameters.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,11 @@ impl<'a> IntermediateConnectionParameters<'a> {
551551
built_in_metrics_report_period_millis: self
552552
.params
553553
.built_in_metrics_report_period_millis,
554-
protocol_logging: Worker_ProtocolLoggingParameters::default(),
554+
protocol_logging: Worker_ProtocolLoggingParameters {
555+
log_prefix: WORKER_DEFAULTS_LOG_PREFIX.as_ptr() as *const i8,
556+
max_log_files: 0,
557+
max_log_file_size_bytes: 0,
558+
},
555559
enable_protocol_logging_at_startup: 0,
556560
logsink_count: self.logsinks.len() as u32,
557561
logsinks: self.logsinks.as_ptr(),

0 commit comments

Comments
 (0)