| 102 | } |
| 103 | |
| 104 | void ModuleNotification::fire(QString path, std::size_t fileSize) |
| 105 | { |
| 106 | if (m_loaded.contains(path)) { |
| 107 | // don't notify if it's been loaded before |
| 108 | return; |
| 109 | } |
| 110 | |
| 111 | m_loaded.insert(path); |
| 112 | |
| 113 | // constructing a Module will query the version info of the file, which seems |
| 114 | // to generate an access violation for at least plugin_python.dll on Windows 7 |
| 115 | // |
| 116 | // it's not clear what the problem is, but making sure this is deferred until |
| 117 | // _after_ the dll is loaded seems to fix it |
| 118 | // |
| 119 | // so this queues the callback in the main thread |
| 120 | |
| 121 | if (m_f) { |
| 122 | QMetaObject::invokeMethod( |
| 123 | m_object, |
| 124 | [path, fileSize, f = m_f] { |
| 125 | f(Module(path, fileSize)); |
| 126 | }, |
| 127 | Qt::QueuedConnection); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | Environment::Environment() {} |
| 132 |
no test coverage detected