Re: File locked problem in c#
From: QPatrik_L=F6wendahl_=5BC=23_MVP=5D=22?= (patrik.lowendahl.no.freakin.spam_at_home.se)
Date: 01/23/05
- Next message: Patrik Löwendahl [C# MVP]: "Re: Visual Studio 2005 Beta - VB dataset question"
- Previous message: Gerry Hickman: "Re: a pre-beginner's question: what is the pros and cons of .net, compared to ++"
- In reply to: Albert Greinöcker: "File locked problem in c#"
- Next in thread: Albert Greinöcker: "Re: File locked problem in c#"
- Reply: Albert Greinöcker: "Re: File locked problem in c#"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 23 Jan 2005 15:21:37 +0100
You should always make sure that you close the streams used to load the
images as well.
Maybe that is the problem you're experiencing?
-- Patrik Löwendahl [C# MVP] http://www.lowendahl.net/ || http://www.cshrp.net Albert Greinöcker wrote: > Hi ng, > > I have a very strange problem within my c# application: > One of the (background) Threads in my application is responsible for some > image processing tasks (like resizing, clipping, ..) on a list of files. > Therefore, some temporary files are created which should be deleted after > processing is finished. > This Thread is called several times. When I call it the first time, > everything's ok and no errors occur. > In the second call, I can observe very strange behaviour: I cannot delete > the temporary files created by this thread, but I'm sure that all image and > bitmap-objects are disposed after processing (with this method,which is, I > think more than should be necessary to release the file lock) > private static void DisposeImage(Image image) > > { > image.Dispose(); > image = null; > GC.Collect(); > } > > Did anyone observe similar behaviour? Does anyone have any ideas what could > be the reason for this annoying file locks (e.g. error in threading or > whatever..) > Or, how could a workaround look like (which means how can I unlock a file > which was created by the same thread) > > thx, > Albert > > >
- Next message: Patrik Löwendahl [C# MVP]: "Re: Visual Studio 2005 Beta - VB dataset question"
- Previous message: Gerry Hickman: "Re: a pre-beginner's question: what is the pros and cons of .net, compared to ++"
- In reply to: Albert Greinöcker: "File locked problem in c#"
- Next in thread: Albert Greinöcker: "Re: File locked problem in c#"
- Reply: Albert Greinöcker: "Re: File locked problem in c#"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading