[Vala] FileStream not closed after going out of scope



Hi, spawning a process and reading the returned pipe in a method like:

...

int input;
int output;
int error;
Pid child_pid;
bool res = Process.spawn_async_with_pipes (null, 
                                                                         runme,
                                                                         null, 
                                                                         SpawnFlags.DO_NOT_REAP_CHILD, 
                                                                         null, 
                                                                         out child_pid,
                                                                         out input,
                                                                         out output,
                                                                         out error );                         
             
                                                                                                              
     
var filestream = FileStream.fdopen (output, "r"); 

...

crashes the program after about 270 "reads" with:

"Failed to create pipe for communicating with child process (Too many open files)"

According to the Vala documentation, streams are closed as soon as they
go out of scope. It seems this is not the case. Or is there any other
explanation why there are too many files left open?

thanks,


-- 
tomw <tomw ubilix com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]