On Sat, 2008-12-27 at 02:06 +0800, Cedric Vivier wrote:
> On Sat, Dec 27, 2008 at 1:56 AM, Sebastien Pouliot
> <[email protected]> wrote:
>         > diff --git a/gendarme/swf-wizard-runner/Wizard.cs
>         b/gendarme/swf-wizard-runner/Wizard.cs
>         > index 445ae08..72e15e8 100644
>         > --- a/gendarme/swf-wizard-runner/Wizard.cs
>         > +++ b/gendarme/swf-wizard-runner/Wizard.cs
>         > @@ -653,11 +653,8 @@ namespace Gendarme {
>         >                         if (save_file_dialog.ShowDialog () !
>         = DialogResult.OK)
>         >                                 return;
>         >
>         > -                       ResultWriter writer =
>         GetSelectedWriter (save_file_dialog.FilterIndex,
>         save_file_dialog.FileName);
>         > -                       if (writer != null) {
>         > +                       using (var writer =
>         GetSelectedWriter (save_file_dialog.FilterIndex,
>         save_file_dialog.FileName))
>         >                                 writer.Report ();
>         > -                               writer.Dispose ();
>         > -                       }
>         >                 }
>         
>         Under which case, using the existing code, will writer avoid
>         to be
>         disposed ?
> 
> If writer.Report () throws - for any reason (any IO or permission
> problem here for instance).

Good point :-) I should have read the rule first (that way I would have
spotted you looked at try/finally) but the defect caught my interest too
quickly.

Sebastien



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Gendarme" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gendarme?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to