Open GoogleCodeExporter opened 9 years ago
When i build my project at Release occure another problem... windows throw
windows "Windows is collecting more information about the problem."
When at Debug windows dont get any problem with my app
WHY??
Original comment by mtester...@gmail.com
on 13 Jan 2012 at 9:39
Don't know anything about YOUR project. My projects work fine in Release.
Original comment by andrew.k...@gmail.com
on 13 Jan 2012 at 9:44
I figure it out:
In class AMMediaType I remove IDisposable interface and remove all method to
dispose (comented all lines where call (AAMediaType).Dispose() method)
All work fine in Debug and Release mode, no exception was raised.
I tested only in case when Capture single image (snapshot) from webcam.
Original comment by mtester...@gmail.com
on 17 Jan 2012 at 9:09
Attachments:
Does not look like a smart fix to me. Dispose method takes care of freeing
memory. So with the fix like yours you just create potential memory leaks.
Original comment by andrew.k...@gmail.com
on 17 Jan 2012 at 9:42
Yes you are right I think this too, but when Dispose be there program after
closing failing, when not be there program work fine all resources was free out
(I thing so), because camera can be used by another program when program
running or not.
Original code failing on Releasing "unkPtr", this attribute dont use anywhere
(this is write in comments: "Not used.") but pointer was set. Why call this
Marshal.Release(unkPtr); ???
Original comment by mtester...@gmail.com
on 17 Jan 2012 at 10:55
1) The issue never happen in the case when there is NO another application
using the camera. So if your application starts using a camera, it allocates
resources, those need to be freed in the end. This sounds as a correct approach
to me.
2) >> Why call this Marshal.Release(unkPtr);
Because it is not NULL. Instead of commenting this line of code, I would better
investigate:
a) why is it not NULL. I would think that if application fails to get access to
a camera, than some pointers should be set to NULL. And if some of them are not
NULL, then it should be safe to call Release() for them.
b) how to detect that the camera is in use and then don't try doing anything
else.
Original comment by andrew.k...@gmail.com
on 17 Jan 2012 at 11:05
Ok Adrew soo the conclusion is what?? (you try this cases? or you still dont
have a camera?)
Dont use Aforge.NET when camera should be use by another program or what? I
dont see any solution :)
Original comment by mtester...@gmail.com
on 17 Jan 2012 at 12:33
>> or you still dont have a camera?
time, which is more expensive.
>> Dont use Aforge.NET when camera should be use by another program or what?
1) What do you expect to get when camera is in use by another application? You
will get nothing anyway. We just need to fix the crash.
2) The code is open - you can fix the issue as well. As you already mentioned
you have a working workaround. So use it in the meantime while there is no fix.
Original comment by andrew.k...@gmail.com
on 17 Jan 2012 at 1:29
I tried your code - works fine for me without any exceptions.
Which system do you have? 32 or 64 bit OS?
Original comment by andrew.k...@gmail.com
on 18 Jan 2012 at 8:15
I've 64bit win 7
Original comment by mtester...@gmail.com
on 18 Jan 2012 at 10:06
Two things to try:
1) Run you application in 32-bit mode - this should work fine.
or
2) Try using the attached file. Just overwrite this file in AForge.NET
framework's sources with a new version and then rebuild
AForge.Video.DirectShow.dll. Hopefully it will help. Sorry, cannot try myself
now - don't have 64 bit Win next to me.
Original comment by andrew.k...@gmail.com
on 19 Jan 2012 at 4:35
Attachments:
I try it when i have a time and I send here a result.
btw. i don't use DLL, I'm using .cs files from AForge
Original comment by mtester...@gmail.com
on 19 Jan 2012 at 4:58
>> btw. i don't use DLL, I'm using .cs files from AForge
It is up to you. Just make sure your application is open source then.
Original comment by andrew.k...@gmail.com
on 19 Jan 2012 at 5:56
Result on x64 machine is:
1) when replace Structure.cs (Platform target=Any CPU)program still crashing
2) when replace Structure.cs and change Platform target (project property) to
x64 from Any CPU program still crashing
3) when replace Structure.cs and change Platform target to x86 program works!!!
4) keep original Structure.cs from AForge 2.2.3.0, Platform x64, program
crashing
5) keep original Structure.cs from AForge 2.2.3.0, Platform x86, program
works!!!
When is x64 machine or project platform set to x64 unkPtr set to 123462096 in
my case :) it's crazy
Don't worry Adrew I dont sell my application :) it's only for fun
Original comment by mtester...@gmail.com
on 20 Jan 2012 at 7:46
Need win 64 for further debugging.
Original comment by andrew.k...@gmail.com
on 20 Jan 2012 at 9:42
Original comment by andrew.k...@gmail.com
on 23 Jan 2012 at 11:46
Original issue reported on code.google.com by
mtester...@gmail.com
on 3 Jan 2012 at 3:00Attachments: