• 3478阅读
  • 0回复

[讨论]qml和C++交互 QLibrary加载后关闭程序内存泄露 [复制链接]

上一主题 下一主题
离线zamxqun
 

只看楼主 倒序阅读 楼主  发表于: 2014-04-22
typedef int (*myfun)();
                    QString path = QCoreApplication::applicationDirPath() + "/windowContrl.dll";
                    QLibrary hdll(path);
                   int result = 0;
                   if(hdll.load())
                   {
                       myfun fun1 = (myfun)hdll.resolve("vCloseFrontWindow");
                       {
                          if ( fun1 )
                          {
                              //result = fun1();
                              //return result;
                              qDebug()<<"loaded";
                          }
                          else
                          {
                              //return -1;
                          }
                       }
                   }
                   else
                   {
                      // return -3;
                   }
                   hdll.unload();很简单的加载动态库,之后,关闭程序会有内存泄露
快速回复
限100 字节
 
上一个 下一个