d3dx9_36/tests [patch 2/2, try 3]: Add tests for D3DXCreatePolygon

Matteo Bruni matteo.mystral at gmail.com
Wed Nov 9 07:42:36 CST 2011


2011/11/9 David Adam <david.adam.cnrs at gmail.com>:
>

Better, but there are still issues:

+    if( polygon ) polygon->lpVtbl->Release(polygon);
+    if( ppBuffer ) ID3DXBuffer_Release(ppBuffer);

You aren't setting those pointers to NULL (and your test shows that
D3DXCreatePolygon doesn't touch them when the call fails), so those
ifs actually are protecting nothing.

In patch 1/2, LockVertex/IndexBuffer should not fail in normal
circumstances, so it's probably better to use ERR instead of TRACE
there.

Also, please, try to fixup the code style. E.g. the preferred style
for 'if's and loops is to have a whitespace between the keyword and
the '(' and no whitespace between the parentheses and the condition.
Stick with that. Don't use hungarian notation (ppBuffer ...), fix
whitespaces around operators, etc



More information about the wine-devel mailing list