@@ -280,7 +280,9 @@ StubLauncher::Launch()
280
280
// Push a dummy message to the message queue so that the stub
281
281
// process is notified that it can release the object stored in
282
282
// shared memory.
283
- stub_message_queue_->Push (DUMMY_MESSAGE);
283
+ if (stub_message_queue_) {
284
+ stub_message_queue_->Push (DUMMY_MESSAGE);
285
+ }
284
286
285
287
// If the model is not initialized, wait for the stub process to exit.
286
288
if (!is_initialized_) {
@@ -303,6 +305,9 @@ StubLauncher::Launch()
303
305
// health thread is spawn would make sure would prevent this issue.
304
306
bi::managed_external_buffer::handle_t message;
305
307
auto err = ReceiveMessageFromStub (message);
308
+ if (err != nullptr ) {
309
+ KillStubProcess ();
310
+ }
306
311
307
312
if (stub_process_kind_ == " AUTOCOMPLETE_STUB" ) {
308
313
if (err != nullptr ) {
@@ -440,7 +445,9 @@ StubLauncher::Launch()
440
445
// Push a dummy message to the message queue so that the stub
441
446
// process is notified that it can release the object stored in
442
447
// shared memory.
443
- stub_message_queue_->Push (DUMMY_MESSAGE);
448
+ if (stub_message_queue_) {
449
+ stub_message_queue_->Push (DUMMY_MESSAGE);
450
+ }
444
451
445
452
// If the model is not initialized, wait for the stub process to exit.
446
453
if (!is_initialized_) {
@@ -465,6 +472,9 @@ StubLauncher::Launch()
465
472
// health thread is spawn would prevent this issue.
466
473
bi::managed_external_buffer::handle_t message;
467
474
auto err = ReceiveMessageFromStub (message);
475
+ if (err != nullptr ) {
476
+ KillStubProcess ();
477
+ }
468
478
469
479
if (stub_process_kind_ == " AUTOCOMPLETE_STUB" ) {
470
480
if (err != nullptr ) {
0 commit comments