Sign in to follow this  

Access Violation with SDL_PollEvent

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

Is that a local variable, a global variable, a member variable? What kind of access violation are you getting? If you can't decide on what is relevant then try creating a minimal but complete code sample that demonstrates your problem: duplicate your project and start deleting code until you get down to the bare minimum amount that still has your issue.

Share this post


Link to post
Share on other sites
[quote name='nano511' timestamp='1312668105' post='4845572']And it cant be broken down any farther then that one line can it?[/quote]That line is not a complete program!

Share this post


Link to post
Share on other sites
...

I wont be able to make a 'test' program. There is nothing wrong with that line of code. I learned it from lazy foo's tutorials.

If i have more then one event structure is it bad?

E: here is the full error:
[code]
Unhandled exception at 0x681064ca in PaddleBattle.exe: 0xC0000005:
Access violation writing location 0xcdcdcdcd.

[break][continue]
[/code]

Share this post


Link to post
Share on other sites
So you expect we can find an error in your code by looking at some peace of code that has nothing wrong with it? How could we?

You can have as many SDL_Events you want. Not that I see why you would need more than one. May I ask why?

Share this post


Link to post
Share on other sites
0xCDCDCDCD is a fill pattern used by MSVC for uninitialized memory. In other words you're probably accessing a pointer to somewhere that you haven't properly allocated. If you want more specific advice, I'd recommend creating a complete, but minimum code example as I've already explained.

Share this post


Link to post
Share on other sites

This topic is 2322 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this