Skip to content

Commit a5cc3d1

Browse files
committed
Add synchronized lock to lcm.stop
Also cleraed session in stop() as well as make taskmaster a daemon thread.
1 parent 11a8e7e commit a5cc3d1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ public void startRPCEncryption() {
163163
}
164164
}
165165

166-
public void stop() {
167-
session.close();
166+
public synchronized void stop() {
167+
if(session != null) {
168+
session.close();
169+
session = null;
170+
}
168171
if (taskmaster != null) {
169172
taskmaster.shutdown();
170173
}
@@ -174,7 +177,7 @@ Taskmaster getTaskmaster() {
174177
if (taskmaster == null) {
175178
Taskmaster.Builder builder = new Taskmaster.Builder();
176179
builder.setThreadCount(2);
177-
builder.shouldBeDaemon(false);
180+
builder.shouldBeDaemon(true);
178181
taskmaster = builder.build();
179182
taskmaster.start();
180183
}

0 commit comments

Comments
 (0)