Explorar o código

deploy-stub: Fix immediate exit on Windows if no log_filename is set

rdb %!s(int64=5) %!d(string=hai) anos
pai
achega
f2e66a280c
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      pandatool/src/deploy-stub/deploy-stub.c

+ 7 - 2
pandatool/src/deploy-stub/deploy-stub.c

@@ -360,15 +360,20 @@ static int enable_line_buffering(PyObject *file) {
   if (method != NULL) {
     PyObject *result = PyObject_Call(method, args, kwargs);
     Py_DECREF(method);
+    Py_DECREF(kwargs);
+    Py_DECREF(args);
     if (result != NULL) {
       Py_DECREF(result);
     } else {
       PyErr_Clear();
       return 0;
     }
+  } else {
+    Py_DECREF(kwargs);
+    Py_DECREF(args);
+    PyErr_Clear();
+    return 0;
   }
-  Py_DECREF(kwargs);
-  Py_DECREF(args);
 #else
   /* Older versions just don't expose a way to reconfigure(), but it's still
      safe to override the property; we just have to use a hack to do it,