Skip to content

Commit

Permalink
[M103 merge] assistant-dlc: Avoid self-reset
Browse files Browse the repository at this point in the history
When assistant is enabled and disabled/enabled again, the `dlc_library_`
could be self-reset.

(cherry picked from commit 28c5665)

Bug: b:232852357
Test: manaul
Change-Id: Ibefeaedda9c482c26e2866acecbc3c3cdb919442
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3652903
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: Yuki Awano <yawano@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1004988}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3656738
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/branch-heads/5060@{#152}
Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
  • Loading branch information
wutao authored and Chromium LUCI CQ committed May 21, 2022
1 parent a894637 commit 2c84402
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chromeos/services/libassistant/libassistant_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class LibassistantFactoryImpl : public LibassistantFactory {
}

base::FilePath path = GetLibassisantPath(dlc_path.value());
// Self-resets are not allowed on unique_ptr.
dlc_library_.reset();
dlc_library_ = base::ScopedNativeLibrary(path);
if (IsDlcLibraryValid()) {
DVLOG(3) << "Loaded libassistant shared library from: " << path;
Expand Down

0 comments on commit 2c84402

Please sign in to comment.