From fe184e2fc9d3400de4cc8ad841c2899774b44da8 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sat, 21 Nov 2020 00:47:44 -0600 Subject: [PATCH] Make objects static so light object references remain valid after detection --- .../PhilipsHueController/PhilipsHueControllerDetect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp b/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp index 717627ff6..2832a1f57 100644 --- a/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp +++ b/Controllers/PhilipsHueController/PhilipsHueControllerDetect.cpp @@ -43,7 +43,7 @@ void DetectPhilipsHueControllers(std::vector& rgb_controllers) /*-------------------------------------------------*\ | Create a finder and find bridges | \*-------------------------------------------------*/ - hueplusplus::BridgeFinder finder(handler); + static hueplusplus::BridgeFinder finder(handler); std::vector bridges;// = finder.FindBridges(); /*-------------------------------------------------*\ @@ -107,7 +107,7 @@ void DetectPhilipsHueControllers(std::vector& rgb_controllers) | away. If not, the user will have to push the | | connect button on the bridge. | \*-------------------------------------------------*/ - hueplusplus::Bridge bridge = finder.GetBridge(bridges[0]); + static hueplusplus::Bridge bridge = finder.GetBridge(bridges[0]); /*-------------------------------------------------*\ | Check to see if we need to save the settings |