Results 1 to 4 of 4

Thread: Qt application crashing - Heap errors?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2010
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt application crashing - Heap errors?

    Hi

    I am busy with my 2nd year computer science project, but I have run into some issues. The problems start when I use QFileDialog, as shown below:


    Qt Code:
    1. QString fileName = QFileDialog::getOpenFileName(parentWidget(), tr("Open File"),
    2. ".",tr("DEM Files (*.map *.dem *.bmp);;All Files(*)"),0,QFileDialog::DontUseNativeDialog);
    To copy to clipboard, switch view to plain text mode 

    I get the following message in my Application output window

    Lowest section in C:\PROGRA~1\COMMON~1\MICROS~1\OFFICE14\Cultures\OF FICE.ODF is .text at 10001000
    Lowest section in C:\PROGRA~1\MICROS~3\Office14\1033\GrooveIntlResou rce.dll is .text at 10001000

    I am not to sure if I should worry about this or why it is happening.

    the next error I get is:
    HEAP[Terrain_Generator.exe]:
    Invalid address specified to RtlFreeHeap( 003E0000, 0C1121C8 )

    which causes my program to crash. It Happens when I return the stat variable, see code below.

    My analysis method that causes the crash
    Qt Code:
    1. TerrainStats* TerrainAnalyser::analyseTerrain(const HeightMap &map, int sweeps, int radius){
    2. Levels = sweeps;
    3.  
    4. if (sweeps < 0)
    5. sweeps = -sweeps;
    6.  
    7. GaussKernel Akern = makeBlurKernel(radius);
    8. HeightMap tmp(map);
    9. HeightMap tmp2(map);
    10. TerrainStats* stats = new TerrainStats(sweeps);
    11.  
    12. for (int cnt = 0; cnt < sweeps; cnt++){
    13. tmp = GaussianBlur(tmp,Akern);
    14. tmp2 = (tmp2 - tmp);
    15. populateStats(tmp2,stats->levelStats[cnt],cnt);
    16. tmp2 = tmp;
    17. }
    18.  
    19. return stats; //<- This is what causes the problem
    20. }
    To copy to clipboard, switch view to plain text mode 

    I tried a simpler example but it doesn't crash, so it must be something stupid that I am overlooking. I have spent 2 days trying to find it but with no success.

    I call the method as follows

    Qt Code:
    1. TerrainStats *stats = TAnalyser->analyseTerrain((*current),6,32);
    2. populateTable((*stats));
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance
    Last edited by System123; 23rd August 2010 at 12:24. Reason: missing [code] tags

Similar Threads

  1. Application crashing
    By addu in forum Qt Programming
    Replies: 9
    Last Post: 22nd May 2009, 10:37
  2. Application crashing on setting Model in QComboBox.
    By kaushal_gaurav in forum Qt Programming
    Replies: 6
    Last Post: 13th February 2009, 18:20
  3. Replies: 4
    Last Post: 1st December 2008, 11:13
  4. application freezes without crashing (and closing)
    By nass in forum Qt Programming
    Replies: 15
    Last Post: 25th September 2007, 11:21
  5. Application is Crashing
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2007, 17:04

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
  •  
Qt is a trademark of The Qt Company.