cvsuser 04/10/04 04:39:53
Modified: include/parrot io.h
io io.c io_private.h
src inter_create.c
Log:
cleanup IO destruction
Revision Changes Path
1.59 +2 -1 parrot/include/parrot/io.h
Index: io.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/io.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -w -r1.58 -r1.59
--- io.h 21 Jun 2004 15:56:04 -0000 1.58
+++ io.h 4 Oct 2004 11:39:49 -0000 1.59
@@ -1,7 +1,7 @@
/* io.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: io.h,v 1.58 2004/06/21 15:56:04 leo Exp $
+ * $Id: io.h,v 1.59 2004/10/04 11:39:49 leo Exp $
* Overview:
* Parrot IO subsystem
* Data Structure and Algorithms:
@@ -147,6 +147,7 @@
/* io.c - If you add new layers, register them in init_layers() */
extern void PIO_init(theINTERP);
extern void PIO_finish(theINTERP);
+void PIO_internal_shutdown(theINTERP);
extern INTVAL PIO_init_stacks(theINTERP);
extern void PIO_atexit(theINTERP);
extern INTVAL PIO_push_layer(theINTERP, ParrotIOLayer *, PMC *);
1.107 +4 -16 parrot/io/io.c
Index: io.c
===================================================================
RCS file: /cvs/public/parrot/io/io.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -w -r1.106 -r1.107
--- io.c 2 Oct 2004 14:48:04 -0000 1.106
+++ io.c 4 Oct 2004 11:39:51 -0000 1.107
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: io.c,v 1.106 2004/10/02 14:48:04 jrieks Exp $
+$Id: io.c,v 1.107 2004/10/04 11:39:51 leo Exp $
=head1 NAME
@@ -37,7 +37,6 @@
/* This is list of valid layers */
ParrotIOLayer **pio_registered_layers = NULL;
-int pio_registered_interpreters = 0;
/* This is the default stack used for IO. Copy this to each new interp */
/*
@@ -276,8 +275,6 @@
return;
}
- /* increase interpreter count */
- ++pio_registered_interpreters;
interpreter->piodata = mem_sys_allocate(sizeof(ParrotIOData));
if (interpreter->piodata == NULL)
@@ -338,9 +335,6 @@
mem_sys_free(interpreter->piodata);
interpreter->piodata = NULL;
- if( --pio_registered_interpreters <= 0 ) {
- PIO_internal_shutdown(interpreter);
- }
}
/*
@@ -348,7 +342,7 @@
=item C<void
PIO_internal_shutdown(theINTERP)>
-IO system destructor, flush streams, free structures, etc.
+IO system destructor, called on destruction of the last interpreter.
=cut
@@ -360,12 +354,6 @@
UNUSED(interpreter);
mem_sys_free(pio_registered_layers);
pio_registered_layers = NULL;
- pio_registered_interpreters = 0;
-#if 0
- PIO_flush(interpreter, pio_stdout);
-#endif
- /*pio_stdout = NULL;
- pio_stderr = NULL;*/
}
/*
1.18 +1 -2 parrot/io/io_private.h
Index: io_private.h
===================================================================
RCS file: /cvs/public/parrot/io/io_private.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- io_private.h 2 Oct 2004 14:48:04 -0000 1.17
+++ io_private.h 4 Oct 2004 11:39:51 -0000 1.18
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: io_private.h,v 1.17 2004/10/02 14:48:04 jrieks Exp $
+$Id: io_private.h,v 1.18 2004/10/04 11:39:51 leo Exp $
=head1 NAME
@@ -262,7 +262,6 @@
ParrotIOLayer * PIO_utf8_register_layer(void);
void PIO_push_layer_str(Interp *interpreter, PMC *pmc, STRING *ls);
STRING* PIO_pop_layer_str(Interp *interpreter, PMC *pmc);
-void PIO_internal_shutdown(theINTERP);
#endif /* PARROT_IO_PRIVATE_H_GUARD */
1.19 +2 -1 parrot/src/inter_create.c
Index: inter_create.c
===================================================================
RCS file: /cvs/public/parrot/src/inter_create.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -w -r1.18 -r1.19
--- inter_create.c 2 Oct 2004 15:22:05 -0000 1.18
+++ inter_create.c 4 Oct 2004 11:39:53 -0000 1.19
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: inter_create.c,v 1.18 2004/10/02 15:22:05 jrieks Exp $
+$Id: inter_create.c,v 1.19 2004/10/04 11:39:53 leo Exp $
=head1 NAME
@@ -337,6 +337,7 @@
* so terminate the event loop
*/
if (!interpreter->parent_interpreter) {
+ PIO_internal_shutdown(interpreter);
Parrot_kill_event_loop();
}