Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QString crash when moving across a plugin boundary
Forum Updated to NodeBB v4.3 + New Features

QString crash when moving across a plugin boundary

Scheduled Pinned Locked Moved General and Desktop
qstringpluginplugin windowscrash
1 Posts 1 Posters 777 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jakob
    wrote on last edited by
    #1

    Recently I noticed the following:

    • In my application there is a 'core' bit, which has a certain function that accepts a const QString&, say f(const QString&) (it's actually a function that will popup a QFileDialog and the string is the caption)
    • The application loads plugins, and the plugins get access to this function f
    • Recently I was calling this function from within the plugin, without explicitly typing a QString, so I was calling f("File Dialog Caption") - in other words, I tried relying on implicit construction
    • This caused a crash in the core part, where, as far as I could tell, the internal data of the QString object was pointing to NULL
    • Then I changed the call by explicitly calling the QString constructor: f(QString("File Dialog Caption")), which resolved this crash

    I'm (almost) sure this has something to do with the magic that happens when moving across dynamic libraries (this is on Windows, but I read that similar problems occur on *nix)

    So, can someone explain (or refer to some clear explanation) about this magic? I have been googling quite a bit, but I find it hard to get details about what is happening. Then the obvious next question is, what is the connection with QString?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved