]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/windows/process.cpp
Delete private data of Process on destruction
[libs/core.git] / source / core / windows / process.cpp
index 3bd03fa3816dbefc3faa71726fa1632c5537cdcd..e19fd6b8f996fd78109880a2c0f59e9bee90b119 100644 (file)
@@ -2,6 +2,7 @@
 #include <msp/core/systemerror.h>
 #include <msp/io/handle_private.h>
 #include <msp/strings/utils.h>
+#include "except.h"
 #include "process.h"
 #include "process_private.h"
 
@@ -43,6 +44,7 @@ Process::~Process()
 {
        CloseHandle(priv->info.hProcess);
        CloseHandle(priv->info.hThread);
+       delete priv;
 }
 
 void Process::platform_get_self_info(Private &priv)
@@ -99,7 +101,7 @@ void Process::execute(const string &command, bool path_search, const Arguments &
 bool Process::wait(bool block)
 {
        if(!running)
-               throw logic_error("not running");
+               throw invalid_state("not running");
 
        DWORD ret = WaitForSingleObject(priv->info.hProcess, (block ? INFINITE : 0));
        if(ret==WAIT_FAILED)