Explorar o código

fix HTTP child problem

Willi Zschiebsch %!s(int64=5) %!d(string=hai) anos
pai
achega
4ab5a66aaa
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      lib/src/ModuleHTTP.cpp

+ 4 - 2
lib/src/ModuleHTTP.cpp

@@ -141,9 +141,11 @@ namespace mdd{
         if(!fname.empty()){
             if (std::filesystem::exists(fname))
             {
-                *_child = child("python3 " + fname + " " + std::to_string(port));
+                _child = std::make_unique<child>("python3 " + fname + " " + std::to_string(port));
+            }
+            else {
+                std::cout << "ERROR Couldnt find: " << fname << std::endl;
             }
-            std::cout << "ERROR Couldnt find: " << fname << std::endl;
         }
         while(!connect()){
             std::this_thread::sleep_for(std::chrono::microseconds(500));