[Mono-bugs] [Bug 357649] GC Error: The object was used after being disposed.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 1 10:25:28 EST 2008


User yhdezalvarez at gmail.com added comment

--- Comment #4 from Yanko Hernandez <yhdezalvarez at gmail.com>  2008-02-01 08:25:28 MST ---
It may be. But In comment #1, the code was (I know I didn't send it, my bad):
static public void SendMail(string users, string TextMessage, string
    StreamWriter sw;
    Process myProcess;
    if (string.IsNullOrEmpty(Configuration.MailDir))
        myProcess = new Process();
        myProcess.StartInfo.FileName = "/usr/sbin/sendmail";
        myProcess.StartInfo.Arguments = string.Format("-f {0} -- {1}",
            Configuration.SanitizeEmails(Configuration.Sender, ""),
            Configuration.SanitizeEmails(users, " "));
        myProcess.StartInfo.UseShellExecute = false;
        myProcess.StartInfo.RedirectStandardInput = true;
        sw = myProcess.StandardInput;
        sw = new StreamWriter(Path.Combine(Configuration.MailDir,
C++.ToString("000"), users)));
    string line;
    using (StreamReader sr = new StreamReader(Configuration.EMailTemplate))
        while ((line = sr.ReadLine()) != null)
            sw.WriteLine(line.Replace("%%TEXT%%", TextMessage)
                             .Replace("%%HTML%%", HTMLMessage)
Configuration.SanitizeEmails(users, ", "))
Configuration.SanitizeEmails(Configuration.Sender, "")));
and it didn't worked either. 

I mean, I moved the declaration of myProcess to the outer block (and left the
construction inside the "if" block) so there were a reference to myProcess till
the end of the method execution. and like the comment says, didn't work either,
same results.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list