Results 1 to 5 of 5

Thread: Access Violation Error (can't find the cause).

  1. #1

    Access Violation Error (can't find the cause).

    In my game, I have blocks setup as being breakable or just normal.

    Depending on which ones I make breakable, when finishing the level and trying to free the stuff up, I get an access violation error on the first breakable object it tries to free (but the error seems to happen before I even check if the object is dead or try anything on it).

    I tested by sticking a ShowMessage in there to see where exactly it fuddles up, but it never shows, it only shows the error (this is in a for loop).

    Is there any good methods of narrowing this down and finding out what on earth is going on?

    Considering if I change which ones are breakable, it will work with some configuration but not others, it's a tad confusing.

  2. #2

    Access Violation Error (can't find the cause).

    does it error on the first breakable object.. or the first breakable object that has been broken?

    Are you freeing up objects as you go and then attempting to free them again at the end?

  3. #3

    Access Violation Error (can't find the cause).

    The first, newly defined breakable object.

    I swapped some non breakable objects, to breakable objects.

    I make them .Dead when collisioned but I check if they are dead or not when I free stuff up before Calling Dead and Free (although calling one or the other makes no difference, the error remains).

  4. #4

    Access Violation Error (can't find the cause).

    some code should be helpfull.
    i got this kind of error usually when i load images 'on the fly', anyway is related to wrong memory access, check if you attempt to write in a nil variable
    Will: "Before you learn how to cook a fish you must first learn how to catch a fish." coolest

  5. #5

    Access Violation Error (can't find the cause).

    Ok, I have been looking at the sprite engine and it appears if I call this:

    [pascal]DXSpriteEngine.Engine.Clear;[/pascal]

    Then I don't even have to write any other code at all and it will handle it for me and it avoids the error (most importantly) lol.

    But just to confirm, does anyone know if this really dead and free's them all up? (e.g. anything in the spriteengine that isn't already dead and free'd).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •