PocoProcessHandle SegmentFault problem

Please post support and help requests here.
Posts: 1
Joined: 25 Apr 2012, 17:07

PocoProcessHandle SegmentFault problem

Postby aliva » 25 Apr 2012, 17:19

I have created a class to handle subprocess in my program

Code: Select all

#include <Poco/Process.h>

class SubProcess{
        *handle = process.launch("ls", args);
    Poco::Process::Args args;
    Poco::Process process;
    Poco::ProcessHandle *handle;

Code: Select all

#include "subprocess.hpp"

int main(int argc, char* argv[]){
    SubProcess sub;

the problem is when program reaches the *handle= it show a SegmentFault message.
when I remove handle object from my code my class works good but I want to use handle in other methods in class.

what should I do for the handle?

Posts: 7
Joined: 28 Nov 2011, 12:50

Re: PocoProcessHandle SegmentFault problem

Postby Tavi » 25 Apr 2012, 21:55

you are defining 'handle' as a pointer and you are not initializing it. Use ProcessHandle as is, without pointer.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest