Results 1 to 2 of 2

Thread: QPrinterInfo::availablePrinters() causes heap corruption in 4.7.1

  1. #1
    Join Date
    Aug 2009
    Location
    Lancashire UK
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Angry QPrinterInfo::availablePrinters() causes heap corruption in 4.7.1

    On Win32, using QT 4.7.1, why do I always get a "trying to free an invalid heap pointer" crash when the following goes out of scope:
    Qt Code:
    1. {
    2. QList<QPrinterInfo> list = QPrinterInfo::availablePrinters();
    3. // ... some more code (or no code at all)
    4. }
    To copy to clipboard, switch view to plain text mode 
    every time !!!

    The crash happens in the C++ destructor of QList<QPrinterInfo>.
    It happens irrespective of current thread (GUI or otherwise).

    I had the problem in 4.5.3.It went away in 4.6.2 but it is back in 4.7.1.

    Any help would be greatly appreciated.
    Last edited by wysota; 30th March 2011 at 12:11. Reason: missing [code] tags

  2. #2
    Join Date
    Mar 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPrinterInfo::availablePrinters() causes heap corruption in 4.7.1

    I had a similar problem: I was using Qt compiled with MSVC2008 in a project MSVC2010. The solution is to compile Qt with MSVC2010 or switch to MSVC2008 in your project.

Similar Threads

  1. Crash: Heap corruption due to selectedRows()
    By Ankitha Varsha in forum Qt Programming
    Replies: 16
    Last Post: 1st October 2010, 00:55
  2. memory corruption
    By Rambobino in forum Qt Programming
    Replies: 2
    Last Post: 10th August 2010, 21:35
  3. Data corruption with read() / ReadFile()
    By Teuniz in forum Qt Programming
    Replies: 5
    Last Post: 20th November 2009, 15:56
  4. Heap Corruption when calling availablePrinters
    By andyp in forum Qt Programming
    Replies: 0
    Last Post: 20th November 2009, 15:15
  5. Widget corruption
    By grzywacz in forum Qt Tools
    Replies: 5
    Last Post: 28th May 2006, 11:48

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.