Jump to content
  • Advertisement
Sign in to follow this  
Leoric

D3DDevice-Present(...) makes app crash

This topic is 5051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I was asking the same question again a few days before but still no one had an answer. Perhaps some pictures can bring some light. The app runs fine and everything is rendered as it should. But after closing the app, the error message "invalid pipe state" ( WinErrCode 230 ) appears and the debugger kicks in telling me there was some trouble with "GetClientRect" and "BitBlt" and stops at the debug breakpoint in NTDLL.DLL Here is my workspace view Here is the modules window Finally, the call stack Does it have something to do with the "Cannot create hardware index buffer" message ? I recently changed from an older Radeon to a R9800 Pro on Catalyst 4.9 The function leading to the crash is: D3DDevice->Present( NULL, NULL, hWnd, NULL ); Before, someone told me it could be an invalid window handle but I tested a lot and I am pretty sure the handle is valid. Not to forget: I have downloaded some source code from the web. Some of the programmes bring exactly the same error. Some don't. Also, the error message disappeares when building against the DX Release-runtime. Maybe someone can help because that damn breakpoint is annoying. Bye, Leoric Edited by Coder: Images too large to be inline [Edited by - Coder on September 16, 2004 3:16:36 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
D3DDevice->Present( NULL, NULL, hWnd, NULL );


Try putting NULL where you have hWnd, I don't think the hWnd is neccesary. Also, what is the HRESULT of that function?

Share this post


Link to post
Share on other sites
Putting NULL in for hWnd doesn't have the slightest effect due to the fact that the hDeviceWindow member of the D3DPRESENT_PARAMETERS is used, which represents the same window handle.

I tested the HRESULT with if( FAILED( hr ) ) return false;
It returns true.

As I mentioned, the programme works fine. It's after hitting the EXIT-button that the error occurs.

Bye,
Leoric

Share this post


Link to post
Share on other sites
The error output suggests that this break (it's not really an error - the release mode of D3D should not cause any crash) occurs due to memory issues.

Make sure to free all D3D resources before exiting the app.
Also unchecking the "Break On Errors" checkbox in DXDiag should prevent this 'crash' from happening.


Share this post


Link to post
Share on other sites
I use the MMGR memory manager and it says "Congratulations. No memory leaks found". I really carefully release any Com-Object.
Given the fact that apps written by other people produce the same error, I don't think it's me being too lazy to release my D3D objects.

And decreasing the debug level isn't really what I want. It's like closing your eyes. The world doesn't change, you just don't see it anymore. And I want to be aware of any error there is.

It seems like I will have to live with it.

Bye,
Leoric

Share this post


Link to post
Share on other sites
You're forgetting to release a DX object. MMGR doesn't track those, the DX debug runtime does, and it's telling you that you're forgetting something. Either that or you're trashing some memory somewhere.

Try commenting out til it goes away and you might be able to narrow it down.

If other peoples' apps cause the same error maybe your DX install is messed up. I really can't think of why it would happen. Maybe some people can send you their apps and you can confirm that it happens.

Share this post


Link to post
Share on other sites
Quote:
Original post by Leoric
I use the MMGR memory manager and it says "Congratulations. No memory leaks found". I really carefully release any Com-Object.
Given the fact that apps written by other people produce the same error, I don't think it's me being too lazy to release my D3D objects.


Have you run DxDiag? Do the same errors happen when they run? What about the SDK samples? You can download numerous samples at my site (www.drunkenhyena.com), do they have the same problem?

If none of the above have the problem then it's pretty likely that the problem is your code. If they don't, then it's likely your setup. Try upgrading your drivers.

Share this post


Link to post
Share on other sites
It sounds like you are still calling your render function after the window has been destroyed. You might try setting a bool on WM_CLOSE and checking the bool before your render call.

Share this post


Link to post
Share on other sites
Quote:
Original post by Leoric
And decreasing the debug level isn't really what I want. It's like closing your eyes. The world doesn't change, you just don't see it anymore.

You'd be surprised ho many commercial titles won't run anymore if you set D3D to its max. debug level and enable 'break on error'[rolleyes]...
Most of these errors aren't even critical (e.g. the debug runtime is able to identify the problem and labels it a "warning" rather than an error).

If you have the desire to write a clean app (which is A Good Thing™[smile]), then the debug output clearly states that there are some unreleased objects. This might be due to a bad installation as others stated, but still it could be your fault.

To track down things like that I'd suggest commenting out parts of your code until the error doesn't occur. Then re-enable until it occurs and you'll find the reason for it.

Good luck,
Pat


Share this post


Link to post
Share on other sites
Quote:
Original post by Dave Hunt
It sounds like you are still calling your render function after the window has been destroyed. You might try setting a bool on WM_CLOSE and checking the bool before your render call.


I'm pretty sure this is exactly the problem. I was having the same problem for a while...I would quit and It would say it tried to present after I released the device. So like he said set a bool that controls your game loop and turn it off when you quit.

while(done == false) {
//Game Loop
}

void CleanUp() {//Fictional clean up function
//Release everything
done = true;
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!