السؤال Memory leak of managed IE toolbar ?

  • Tuesday, February 07, 2012 7:50 AM
     
      Has Code

    I found a memory leak of System.Windows.Forms.Application+ThreadContext when IE loaded managed toolbar.

    Each time i open a new tab, the ThreadContext will be constructed. but after I close  the new tab, the ThreadContext won't be detroyed.

    It seems that a static Hashtable keeps the instance of the ThreadConext. It won't be removed from the hashtable.

    the following is the gcroot command result in windbg:

    0:015> !gcroot 03e23954
    Scan Thread 6 OSTHread 1e84
    Scan Thread 8 OSTHread 1860
    Scan Thread 9 OSTHread 1ea8
    DOMAIN(0019B640):HANDLE(Pinned):3cb13ec:Root:04e13250(System.Object[])->
    03e13108(System.Collections.Hashtable)->
    03e13140(System.Collections.Hashtable+bucket[])->
    03e131dc(System.Windows.Forms.Application+ThreadContext)

    How could I remove this leak?

    Thanks,

    Calvin

All Replies