Return-Path: X-Original-To: apmail-logging-log4net-dev-archive@www.apache.org Delivered-To: apmail-logging-log4net-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C15B9101AE for ; Tue, 28 Jan 2014 12:52:42 +0000 (UTC) Received: (qmail 5278 invoked by uid 500); 28 Jan 2014 12:52:42 -0000 Delivered-To: apmail-logging-log4net-dev-archive@logging.apache.org Received: (qmail 5033 invoked by uid 500); 28 Jan 2014 12:52:40 -0000 Mailing-List: contact log4net-dev-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET Dev" List-Id: Delivered-To: mailing list log4net-dev@logging.apache.org Received: (qmail 4816 invoked by uid 99); 28 Jan 2014 12:52:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jan 2014 12:52:38 +0000 Date: Tue, 28 Jan 2014 12:52:38 +0000 (UTC) From: "Mat Arge (JIRA)" To: log4net-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4NET-420) Destructor of class called upon invoking XmlConfigurator.Configure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4NET-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13884083#comment-13884083 ] Mat Arge commented on LOG4NET-420: ---------------------------------- But the object is destroyed right after (during) the call to Configure. At this point, there is still an active reference to the object so the Garbage Collector should not claim it. > Destructor of class called upon invoking XmlConfigurator.Configure > ------------------------------------------------------------------ > > Key: LOG4NET-420 > URL: https://issues.apache.org/jira/browse/LOG4NET-420 > Project: Log4net > Issue Type: Bug > Components: Core > Affects Versions: 1.2.10, 1.2.13 > Environment: Linux (openSuse 12.2 i586), Mono 2.10.9 > Reporter: Mat Arge > > If I run XmlConfigurator.Configure on an XML File after an instance of some class has been created, the destructor of that class is called for some reason. Here is my test code: > using System; > > public class Test > { > ~Test() > { > Console.WriteLine("Test object finalized."); > } > } > public static class M > { > public static void Main() > { > Console.WriteLine("Start"); > Test test = new Test(); > Console.WriteLine("configuring"); > log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("LogConfiguration.xml")); > Console.WriteLine("End"); > } > } > Running this yields the output: > Start > configuring > Test object finalized. > End > I'm not really sure, if this is a bug in log4net or in mono -- This message was sent by Atlassian JIRA (v6.1.5#6160)