List Info

Thread: using does not call Dispose()




using does not call Dispose()
user name
2007-10-09 12:21:58
Follow-up Comment #5, bug #20790 (project dotgnu-pnet):

Hi Klaus,
could you please commit your patch? It works perfectly for
me.

Thanks
Radek

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

using does not call Dispose()
user name
2007-08-15 10:16:40
URL:
  <http://savann
ah.gnu.org/bugs/?20790>

                 Summary: using does not call Dispose()
                 Project: DotGNU Portable.NET
            Submitted by: radekp
            Submitted on: Wednesday 08/15/2007 at 15:16
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Hello,
this is bug in cscc compiler. It does not emit call to
Dispose() method on
following code block:

		IDisposable obj = new SomethigDisposable();
		using(obj)
		{
		} // Dispose() on obj should be called here

I've attached also and sample app.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wednesday 08/15/2007 at 15:16  Name:
ConsoleApp1.tar.gz  Size: 1kB  
By: radekp

<http://savannah.gnu.org/bugs/download.php?file_id=136
69>

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

using does not call Dispose()
user name
2007-09-18 16:11:32
Follow-up Comment #1, bug #20790 (project dotgnu-pnet):

That's a quick patch, do I need to check the yyisa function
to make sure the
fix is implementend the right way?

(file #13984)
    _______________________________________________________

Additional Item Attachment:

File name: usingPatch.diff                Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

using does not call Dispose()
user name
2007-09-19 01:29:10
Follow-up Comment #2, bug #20790 (project dotgnu-pnet):

Hi,
this patch might fix the issue with a one part using
statement like it's used
in the testcase.
So you should use the yyisa to check if it's no
expressionlist because
statements like using(a, b, c) are allowed too.

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

using does not call Dispose()
user name
2007-09-22 10:09:11
Follow-up Comment #3, bug #20790 (project dotgnu-pnet):

Hi,

i tried the patch now.
using this simple (even illegal because Object doesn't
implement IDisposable)
testcase:

using System;

public class Test
{
	static void Test1()
	{
		Object a = 0;

		using(a)
		{
		}
	}
}

emits the following output:

.class public auto ansi 'Test' extends
['.library']'System'.'Object'
{
.method private static hidebysig void 'Test1'() cil managed
{
        .locals init    (class
['.library']'System'.'Object')
        ldc.i4.0
        box     ['.library']'System'.'Int32'
        stloc.0
        .try {
        leave   ?L1
        } finally {
        ldloc   39504       <--- the problem is here
        brfalse ?L2
        ldloc   39504
        callvirt        instance void
[.library]System.IDisposable:ispose()

        endfinally
?L2:
        }
?L1:
        ret
        .maxstack 1
} // method Test1

It looks like varnode is not initialized at this point.
Did you miss something in your patch?


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

using does not call Dispose()
user name
2007-09-30 03:34:20
Update of bug #20790 (project dotgnu-pnet):

                  Status:                    None => In
Progress            
             Assigned to:                    None =>
ktreichel              

    _______________________________________________________

Follow-up Comment #4:

Can you check the attached patch and see if it solves your
issue?

(file #14047)
    _______________________________________________________

Additional Item Attachment:

File name: kt-070930.patch                Size:2 KB


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

using does not call Dispose()
user name
2007-10-13 04:55:28
Update of bug #20790 (project dotgnu-pnet):

                  Status:             In Progress =>
Fixed                  
             Open/Closed:                    Open =>
Closed                 

    _______________________________________________________

Follow-up Comment #6:

The using statement is fixed now for expressions.

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20790>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )