DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 25 Jul 2007 22:22:01 -0700,    posted on: microsoft.public.dotnet.framework.clr        back       

Thread Index
  1    Armin


System.Windows.Forms.Control based classes are not collected in CF   
Hello,

I'm not able to figure out how to collect/ dispose classes based on 
System.Windows.Forms.Control. Under Windows CE the memory will fill up until 
i get an out of memory exception. On my PC everything works fine. I'm running 
Windows CE 5.

What can I do?

Thanks,
Armin

Code:


using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Garbage
{
public class GoodGarbage
{
private byte[] m_Memory;
public GoodGarbage()
{
m_Memory = new byte[8196];
}

~GoodGarbage()
{
}
}

public class BadGarbage : System.Windows.Forms.Control
{
private byte[] m_Memory;

public BadGarbage()
{
m_Memory = new byte[8196];
}

~BadGarbage()
{
}
}

static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[MTAThread]
static void Main()
{
while (true)
{
GoodGarbage gg = new GoodGarbage();
BadGarbage bg = new BadGarbage();

if (bg is IDisposable)
(bg as IDisposable).Dispose();

System.Threading.Thread.Sleep(1);
}
}
}
}
Date:Wed, 25 Jul 2007 22:22:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us