From a8495549d05aa6588a333eb2bc79d5cc0eb48376 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Tue, 3 Jan 2012 10:26:32 +0100 Subject: CodeCoverage: Remove releaseCoverageTool() function. QLibraryPrivate::release() can be called multiple times and it is not appropriate to unregister and save the executed data for a library there. The library may still be used when it is released and it seems safer to save its data only once and probably when the application ends. Not calling __coveragescanner_unregister_library does not affect the coverage data. Calling __coveragescanner_register_library at load time without calling __coveragescanner_unregister_library means the plugin will stay loaded until the application ends. Removing the call to releaseCoverageTool() is so acceptable since the data will be saved when the application exits. Task-number: QTQAINFRA-416. Change-Id: I3135d2e203ecacfeff4a5b8ffdcd4d62fbc1db33 Reviewed-by: Rohan McGovern --- src/corelib/plugin/qlibrary.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src') diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index eeec831d4a..f20abb660d 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -430,25 +430,6 @@ static void installCoverageTool(QLibraryPrivate *libPrivate) #endif } -static void releaseCoverageTool(QLibraryPrivate *libPrivate) -{ -#ifdef __COVERAGESCANNER__ - /* - __COVERAGESCANNER__ is defined when Qt has been instrumented for code - coverage by TestCocoon. - Here is the code to save the execution data. - See comments about initialization in QLibraryPrivate::load(). - */ - if (libPrivate->pHnd) { - __coveragescanner_save(); - __coveragescanner_clear(); - __coveragescanner_unregister_library(libPrivate->fileName.toLocal8Bit()); - } -#else - Q_UNUSED(libPrivate); -#endif -} - typedef QMap LibraryMap; struct LibraryData { @@ -545,8 +526,6 @@ bool QLibraryPrivate::unload() void QLibraryPrivate::release() { - releaseCoverageTool(this); - QMutexLocker locker(qt_library_mutex()); if (!libraryRefCount.deref()) delete this; -- cgit v1.2.3