Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
remove unused global functions
  • Loading branch information
kegechen committed Jan 10, 2024
1 parent 7d4ea9d commit 1e27a44
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/dtkcore_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,6 @@
#error "DTK_VERSION or DTK_VERSION_STR not defined!"
#endif

void doubleLoadCheck()
{
// logic error
/*QFile f("/proc/self/maps");
if (!f.open(QIODevice::ReadOnly))
qFatal("%s", f.errorString().toLocal8Bit().data());
const QByteArray &data = f.readAll();
QTextStream ts(data);
QString modulePath;
while (Q_UNLIKELY(!ts.atEnd())) {
const QString line = ts.readLine();
const QStringList &maps = line.split(' ', QString::SplitBehavior::SkipEmptyParts);
if (Q_UNLIKELY(maps.size() < 6))
continue;
QFileInfo info(maps.value(5));
const QString &infoAbPath = info.absoluteFilePath();
if (modulePath == infoAbPath || !info.fileName().contains("dtkcore") || info.fileName().contains("dtkcore.so.2"))
continue;
if (modulePath.isEmpty()) {
modulePath = infoAbPath;
} else {
// modulePath != infoAbPath
QByteArray msg;
msg += modulePath + " and " + info.absoluteFilePath() + " both loaded";
qFatal("%s", msg.data());
}
}*/
}

// 在库被加载时就执行此函数
__attribute__((constructor)) void init()
{
doubleLoadCheck();
}

int dtkVersion()
{
return DTK_VERSION;
Expand Down

0 comments on commit 1e27a44

Please sign in to comment.