You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Ron Grabowski (JIRA)" <ji...@apache.org> on 2008/05/29 01:26:45 UTC

[jira] Commented: (LOG4NET-158) XMLConfigurator.ConfigureAndWatch() leaks resources if called multiple times

    [ https://issues.apache.org/jira/browse/LOG4NET-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600643#action_12600643 ] 

Ron Grabowski commented on LOG4NET-158:
---------------------------------------

Do we just need to forcible Dispose the watcher since we're not using it anymore?

 private void OnWatchedFileChange(object state)
 {
  // release resources being watched
 FileSystemWatcher watcher = (FileSystemWatcher)state;
 watcher.EnableRaisingEvents = false;
 watcher.Dispose();

 XmlConfigurator.InternalConfigure(m_repository, m_configFile);
}

> XMLConfigurator.ConfigureAndWatch() leaks resources if called multiple times
> ----------------------------------------------------------------------------
>
>                 Key: LOG4NET-158
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-158
>             Project: Log4net
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 1.2.10
>         Environment: Windows Server 2003, Windows XP
>            Reporter: Strategic Insurance Software
>
> If XMLConfigurator.ConfigureAndWatch() is called multiple times within an AppDomain, each time it is called it leaks a Win32 file  handle (possibly from a FileSystemWatcher object not being disposed?) to the folder containing the previous configuration file it was watching.
> Desired behavior would be to release the handle to the folder containing the previous configuration file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.