Results 1 to 4 of 4

Thread: QFile::open throws std::bad_alloc for no obvious reason

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Posts
    19
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QFile::open throws std::bad_alloc for no obvious reason

    Constructing QFile object:
    Qt Code:
    1. QFile file("file.ext");
    To copy to clipboard, switch view to plain text mode 
    "file.ext" is present in working directory. Calling file.open(QFile::ReadOnly | QFile::Text) terminates application with error:
    terminate called after throwing an instance of 'std::bad_alloc'
    what(): std::bad_alloc

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    The same happens if I try to open embedded resource file.
    It can't be the lack of memory because I have 2 of 4 GB of RAM free, neither the lack of available file handles to acquire, since Windows imposes no limitations on this.
    Any help would be greatly appreciated.

    P.S. The code that tries to open the file is loaded and executed from shared library, but I highly doubt that it can be the case.
    P.P.S. Qt 4.6, Windows XP SP3
    Last edited by nateriver; 28th December 2009 at 16:44. Reason: Forgot to tell qt and windows versions
    "Do be do be do", Frank Sinatra

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.