Jump to content
  • Advertisement
Sign in to follow this  

Heap Error if I declare an shader resource array

This topic is 3755 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 {
public:
   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:
Quote:
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
Advertisement
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!