Re: DDRAW: Fix reference counting

2005-09-21 Thread Jakob Eriksson
Stefan Dösinger wrote: Hello, In that case, it would be really beneficial with a unit test. Both as documentation and to see what Windows does. Excuse my ignorance, but what exactly is meant with 'unit test'? As far as I've learned, it's a small piece of code which uses this

Re: DDRAW: Fix reference counting

2005-09-19 Thread Stefan Dösinger
Hi, Why do you increase the refcount by 2? Since you add and release them in the same functions, it is not really necessary and just adds complexity to the code. Well, Windows does so for some reason, and after what I've seen with Empire Earth, I suspect that there are some apps out there

Take 2: DDRAW: Fix reference counting

2005-09-19 Thread Stefan Dösinger
Hello, This patch increases the reference count of a DirectDraw object when a Surface is created, like Windows does. It also adds a test which tests this functionality. This time with the !FAILED() - SUCCEEDED() suggestion from Robert Shearman. I kept adding a secound refcount in case of

Re: DDRAW: Fix reference counting

2005-09-19 Thread Jakov af Wallby
On Mon, Sep 19, 2005 at 09:27:05AM +0200, Stefan D?singer wrote: Hi, Why do you increase the refcount by 2? Since you add and release them in the same functions, it is not really necessary and just adds complexity to the code. Well, Windows does so for some reason, and after what I've seen

Re: DDRAW: Fix reference counting

2005-09-19 Thread Stefan Dösinger
Hello, In that case, it would be really beneficial with a unit test. Both as documentation and to see what Windows does. Excuse my ignorance, but what exactly is meant with 'unit test'? As far as I've learned, it's a small piece of code which uses this functionality and checks the results. My

Re: DDRAW: Fix reference counting

2005-09-18 Thread Robert Shearman
Stefan Dösinger wrote: Hello, This patch increases the reference count of a DirectDraw object when a Surface is created, like Windows does. It also adds a test which tests this functionality. Stefan Dösinger