Ticket #1659 (closed bug: fixed)
FileHandle objects don't honour timely destruction
| Reported by: | plobsing | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | none | Version: | 2.4.0 |
| Severity: | medium | Keywords: | |
| Cc: | Language: | ||
| Patch status: | applied | Platform: |
Description
Converting a test in t/pmc/io.t to use the OO FileHandle interface, I discovered that only filehandles opened with 'open' get timely destruction.
This fails:
pir_output_is( sprintf(<<'CODE', $temp_file), <<'OUTPUT', "timely destruction" );
.const string temp_file = '%s'
.sub main :main
interpinfo $I0, 2 # GC mark runs
$P0 = new ['FileHandle']
$P0.'open'(temp_file, 'w')
needs_destroy $P0
print $P0, "a line\n"
null $P0 # kill it
sweep 0 # a lazy GC has to close the PIO
$P0 = new ['FileHandle']
$P0.'open'(temp_file, 'r')
$S0 = $P0.'read'(20)
print $S0
.end
CODE
a line
OUTPUT
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

