Upptäck minnesläckor med Heob

I Windows använder du Heob-heapobservatören för att upptäcka buffertöverskridningar och minnesläckor.

Så här kör du Heob på det projekt som för närvarande är öppet:

  1. Välj ” Analyze ” > ” Heob ”.

    Heob-inställningar

  2. Välj den Heob-inställningsprofil som ska användas, eller välj ” New ” för att skapa en ny profil.
  3. I Heob path anger du sökvägen till den körbara Heob-filen.
  4. Ange inställningar för att köra kontrollerna.
  5. Välj OK för att köra Heob.

Qt Creator kör programmet och kör sedan Heob i en terminal.

Heob körs i en terminal

Heob genererar ett åtkomstfel vid buffertöverskridningar och registrerar stacktraces för den felaktiga instruktionen och buffertallokeringen. Du kan se resultaten i vyn ” Memcheck ” efter att Heob har avslutats normalt.

Resultat från Heob i Memcheck-vyn

Se även Så här gör du: Analysera, Analysatorer, Heob och Analysera kod.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.