Fix sp<> crash on stack-allocated service object.

Bug: 145609858
Test: build, boot
Change-Id: Ia705750c77ee8ba950d19eae9bbd208b0dac2310
This commit is contained in:
Tomasz Wasilczyk
2019-12-05 13:54:50 -08:00
parent 66135e5405
commit 201734e551

View File

@@ -32,8 +32,8 @@ static void canControllerService() {
configureRpcThreadpool(16, true);
LOG(DEBUG) << "CAN controller service starting...";
CanController canController;
if (canController.registerAsService("socketcan") != OK) {
sp<CanController> canController(new CanController);
if (canController->registerAsService("socketcan") != OK) {
LOG(FATAL) << "Failed to register CAN controller";
return;
}