🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #272359

Re: [SGCL] Odśmiecania współbieżnego ciąg dalszy

#272359
From: Marcin ‘Qrczak’ Kowalczyk
Date: Wed, 27 Feb 2008 20:33
57 lines
3229 bytes
Dnia 27-02-2008, Śr o godzinie 21:19 +0100, Artur Bać pisze:

> wkleilem kod filestream z NET
> uzyskany NET reflektorem i widac tam liczenie referencji i igonorowanie 
> Close() samego FileStream.

http://msdn2.microsoft.com/en-us/library/system.io.filestream.dispose.aspx

"Dispose() - Infrastructure. Releases all resources used by the Stream.
(Inherited from Stream.)"

Nie ma mowy o jakimś zliczaniu referencji.

Implementacja w Mono:

        ~FileStream ()
        {
                Dispose (false);
        }

#if NET_2_0
        protected override void Dispose (bool disposing)
#else
        protected virtual void Dispose (bool disposing)
#endif
        {
                if (handle != MonoIO.InvalidHandle) {
                        FlushBuffer ();

                        if (owner) {
                                MonoIOError error;

                                MonoIO.Close (handle, out error);
                                if (error != MonoIOError.ERROR_SUCCESS) {
                                        // don't leak the path information for isolated storage
                                        string fname = (anonymous) ? Path.GetFileName (name) : name;
                                        throw MonoIO.GetException (fname, error);
                                }

                                handle = MonoIO.InvalidHandle;
                        }
                }

                canseek = false;
                access = 0;
                if (disposing) {
                        buf = null;
                }
        }

Jak widać, nie ma żadnego zliczania referencji (pole "owner" z reguły
jest true, jest false chyba tylko dla stdin/stdout/stderr).

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
Technical Details
Message-ID: <1204144410.20097.7.camel@qrnik>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!opal.futuro.pl!news.internetia.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <fppvdq$68v$1@inews.gazeta.pl> <fq0od3$5bm$1@inews.gazeta.pl> <fq0qpa$ekv$1@inews.gazeta.pl> <fq0s58$jvv$1@inews.gazeta.pl> <fq0tjl$shn$1@news.vectranet.pl> <fq10ir$8nn$1@inews.gazeta.pl> <fq140s$2u6$1@news.vectranet.pl> <fq164t$3bl$1@inews.gazeta.pl> <fq1mqa$kqq$1@news.vectranet.pl> <fq42jk$k6t$1@bozon2.softax.pl> <fq4co0$5en$1@news2.task.gda.pl> <1204141451.18837.31.camel@qrnik> <fq4gkt$soi$1@news2.task.gda.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!opal.futuro.pl!news.internetia.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: Marcin ‘Qrczak’ Kowalczyk
 <qrczak@knm.org.pl>
Newsgroups: pl.comp.lang.c
Subject: Re: [SGCL]
 Odśmiecania współbieżnego ciąg dalszy
Date: Wed, 27 Feb 2008 21:33:30 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 61
Message-ID: <1204144410.20097.7.camel@qrnik>
References: <fppvdq$68v$1@inews.gazeta.pl> <fq0od3$5bm$1@inews.gazeta.pl>  <fq0qpa$ekv$1@inews.gazeta.pl> <fq0s58$jvv$1@inews.gazeta.pl>  <fq0tjl$shn$1@news.vectranet.pl> <fq10ir$8nn$1@inews.gazeta.pl>  <fq140s$2u6$1@news.vectranet.pl> <fq164t$3bl$1@inews.gazeta.pl>  <fq1mqa$kqq$1@news.vectranet.pl> <fq42jk$k6t$1@bozon2.softax.pl>  <fq4co0$5en$1@news2.task.gda.pl> <1204141451.18837.31.camel@qrnik>  <fq4gkt$soi$1@news2.task.gda.pl>
NNTP-Posting-Host: hjd150.internetdsl.tpnet.pl
Mime-Version: 1.0
X-Trace: atlantis.news.tpi.pl 1204144486 23070 79.187.237.150 (27 Feb 2008 20:34:46 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Wed, 27 Feb 2008 20:34:46 +0000 (UTC)
In-Reply-To: <fq4gkt$soi$1@news2.task.gda.pl>
X-Mailer: Evolution 2.12.1 PLD Linux
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit