call init.py/shutdown on application close
[pykit.git] / PythonPublisher.cc
index 410f707..c6ad1fc 100644 (file)
@@ -459,7 +459,12 @@ prefix_ pykit::PythonPublisher::PythonPublisher()
 }
 
 prefix_ pykit::PythonPublisher::~PythonPublisher()
-{}
+{
+    try {
+        impl_->mainNamespace["shutdown"]();
+    }
+    catch (...) {;}
+}
 
 prefix_ void pykit::PythonPublisher::publish(Request & request)
 {