Results 1 to 4 of 4

Thread: Weird Acces violation when closing the application

  1. #1

    Weird Acces violation when closing the application

    OS: Vista Ultimate
    IDE: Delphi 7
    API: n.a

    Hi everyone.

    I got this weird problem. Sometimes when i close my application (my WIP), the CPU window pops up, and an AV is shown. The adresses shown in the AV are alway's one of 3 or 4 different adresses. The place where it happens in the source also differs. I don't know any source adresses that are shown in the CPU window. I think it crashes somewhere in an unknown DLL. I see some "RTL" routines in the dissasembled lines of code.

    This doesn't seem to happen on my laptop which runs on XP pro. :?

    Any idea's where this might come from, and how to get rid of it? Should i worry about this, or is it probably a driver or OS bug etc...

    Any usefull replies would be highly appreciated.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    Weird Acces violation when closing the application

    A few things to think about.

    1) Double check all free operations. Freeing pointers, clearing arrays, and nullifying certain types in slightly wrong ways can make big errors on exit.

    2) Ensure that you are actually not freeing things in the improper order. For example Zlib is dependent upon a child stream that you pass it to decompress from, or compress to. If you free the wrong one first then you can have errors while freeing the other.

    3) Lost surfaces/canvases. Timed operations and such that hit a losable canvas or surface can cause these, but a simple "timer.enabled := false" at the beginning of your close/destroy event can prevent it.

    I know they're all elementary things you've probably thought of, but they are the most common, simplistic, mistakes that you can make. Many times I've shot myself in the foot like this. Maybe if you show the close/destroy event that is called when you close the application I could help, but without source I can't do more than this.

  3. #3

    Weird Acces violation when closing the application

    chronozphere, use FastMM with its debugging features turned on. It reports all invalid FreeMem calls etc.

  4. #4

    Weird Acces violation when closing the application

    AFAIK, my program free's all data it uses. If that was the problem, i probably would get it EVERY time i ran the app, and it would show me a good usefull source-line, where the AV occured, I think. :?

    I have downloaded FastMM, but i dont know how to use it to diagnose this problem.

    Can someone provide me with a list of things i have to do, to find the source of this AV?

    Thanx alot!
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

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
  •