J
juvi
OS........: [CE 5.0 / WM5.0 / WM6.0]
Hardware..: [HTC TOUCH DIAMOND]
Processor.: [Qualcomm MSM7201A]
I am trying to implement a "change theme" functionality in my application.
Unfortunately when using this function a few times it seems to run into a
memory leak.
I am using .net CF 2.0 (with C#) and the following:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using OpenNETCF.Drawing.Imaging;
My images are loaded into an image array and I thought I can release them
from memory when loading images again into that array (some kind of overide -
but this is not the case, because it grows in memory)
Here's the code I use:
IImage[] image = new IImage[65];
ImagingFactory factory = new ImagingFactoryClass();
public void LoadImages()
{
...
factory.CreateImageFromStream(new StreamOnFile("Image1.png"), out
image[1]);
factory.CreateImageFromStream(new StreamOnFile("Image2.png"), out
image[2]);
factory.CreateImageFromStream(new StreamOnFile("Image3.png"), out
image[3]);
...
}
So when changing to another theme I reload my images with LoadImages() and
the memory usage grows every time with about 0.5MB
I would much appreciate any pointers you can give me.
Thanks!
juvi
Hardware..: [HTC TOUCH DIAMOND]
Processor.: [Qualcomm MSM7201A]
I am trying to implement a "change theme" functionality in my application.
Unfortunately when using this function a few times it seems to run into a
memory leak.
I am using .net CF 2.0 (with C#) and the following:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using OpenNETCF.Drawing.Imaging;
My images are loaded into an image array and I thought I can release them
from memory when loading images again into that array (some kind of overide -
but this is not the case, because it grows in memory)
Here's the code I use:
IImage[] image = new IImage[65];
ImagingFactory factory = new ImagingFactoryClass();
public void LoadImages()
{
...
factory.CreateImageFromStream(new StreamOnFile("Image1.png"), out
image[1]);
factory.CreateImageFromStream(new StreamOnFile("Image2.png"), out
image[2]);
factory.CreateImageFromStream(new StreamOnFile("Image3.png"), out
image[3]);
...
}
So when changing to another theme I reload my images with LoadImages() and
the memory usage grows every time with about 0.5MB
I would much appreciate any pointers you can give me.
Thanks!
juvi