Skip to content

Commit

Permalink
[fix] global: disable OpenCL
Browse files Browse the repository at this point in the history
Disable OpenCL globally to fix memory leaks on Windows and to increase performance.
  • Loading branch information
bgallois committed Mar 17, 2022
1 parent 703eeda commit 02bbe59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion FastTrack.pri
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = 6.2.4.1
VERSION = 6.2.4.2
2 changes: 2 additions & 0 deletions src/fasttrack-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ All arguments are mandatory except --backPath and --cfg. Loading a configuration
}

int main(int argc, char **argv) {
char env[] = "OPENCV_OPENCL_DEVICE=disabled";
putenv(env); // disable OpenCL to fix windows memory leaks and increase performance
static struct option long_options[] =
{
{"maxArea", required_argument, 0, 'a'},
Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This file is part of Fast Track.
along with FastTrack. If not, see <https://www.gnu.org/licenses/>.
*/

#include <stdlib.h>
#include <QApplication>
#include <QDir>
#include <QFont>
Expand All @@ -34,6 +35,8 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
}

int main(int argc, char *argv[]) {
char env[] = "OPENCV_OPENCL_DEVICE=disabled";
putenv(env); // disable OpenCL to fix windows memory leaks and increase performance
QApplication a(argc, argv);
QPixmap pixmap(QStringLiteral(":/assets/icon.png"));
QSplashScreen splash(pixmap);
Expand Down

0 comments on commit 02bbe59

Please sign in to comment.