Skip to content
Snippets Groups Projects

QDS-10490 Crash on QRC allocation

Merged Burak Hançerli requested to merge QDS-10490/crash-on-qrc-allocation into master
2 files
+ 19
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -65,11 +65,23 @@ QString DvBase::unpackProject(const QByteArray &project, bool extractZip)
@@ -65,11 +65,23 @@ QString DvBase::unpackProject(const QByteArray &project, bool extractZip)
if (projectLocationDir.isEmpty()) {
if (projectLocationDir.isEmpty()) {
if (extractZip)
if (extractZip)
printLog("File could not be extracted. Trying to open it as a resource file.");
printLog("File could not be extracted. Trying to open it as a resource file.");
const uchar *data = reinterpret_cast<const uchar *>(project.data());
printLog("Registering resource data. Size: " + QString::number(project.size()));
const uchar *data;
 
if (m_projectData.size()) {
 
printLog("Unregistering the previous data from QRC system. Path: " + m_projectPath
 
+ " Size: " + QString::number(m_projectData.size()) + " bytes.");
 
data = reinterpret_cast<const uchar *>(m_projectData.data());
 
if (!QResource::unregisterResource(data, m_projectPath)) {
 
printErr("Cannot unregister the previous resource data.");
 
}
 
}
 
 
m_projectData = project;
 
data = reinterpret_cast<const uchar *>(m_projectData.data());
 
printLog("Registering resource data. Size: " + QString::number(m_projectData.size()));
const QString resourcePath{"/" + QString::number(QRandomGenerator::global()->generate())};
const QString resourcePath{"/" + QString::number(QRandomGenerator::global()->generate())};
// const QString resourcePath{"/qtdesignviewer"};
m_projectPath = resourcePath;
if (!QDir(resourcePath).removeRecursively()) {
if (!QDir(resourcePath).removeRecursively()) {
printLog("Could not remove resource path: " + resourcePath);
printLog("Could not remove resource path: " + resourcePath);
Loading