Jump to content
  • Advertisement
Sign in to follow this  

Heap Error if I declare an shader resource array

This topic is 3911 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

Hello, I have a strange error in my application: I created a terrain class, which loads a .fx shader file in the constructor and has a render method which sets a texture, a matrix and then renders the technique in the .fx file (so nothing special and everything works). Now I wanted to add 5 textures to my terrain class, so I added this line in my class declaration:
class Terrain {
   ID3D10EffectShaderResourceVariable* textureLayersSC[5]; // I only added THIS line
I dont do anything with textureLayerSC in the Terrain methods! If I start the application now everything works again but if I close the application I get an error popup window:
Windows has triggered a breakpoint in SkyRendering.exe. This may be due to a corruption of the heap, and indicates a bug in SkyRendering.exe or any of the DLLs it has loaded.
I have no idea what causes this since I dont allocte anything new on the heap! I thought about that I miss to clean up something in the destructor but the array gets destroyed automatically, so there shouldnt be anything I have to do. Anyone has an idea what causes this error?

Share this post

Link to post
Share on other sites
When it crashes, look at the call stack and see what line in your code it crashed on. My guess is that you're Release()ing an uninitialised pointer.

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!