changeset 143:16f8471e3872

Performance warning if runtime debug assertions are turned on
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 Sep 2016 09:13:53 +0200
parents d9e3f7bb9986
children daf99382bc18
files CMakeLists.txt NEWS Plugin/Plugin.cpp
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Wed Jul 20 13:01:30 2016 +0200
+++ b/CMakeLists.txt	Wed Sep 07 09:13:53 2016 +0200
@@ -57,7 +57,7 @@
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake)
 
 
-# Check that the Orthanc SDK headers are available or download them
+# Check that the Orthanc SDK headers are available
 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
   include_directories(${ORTHANC_ROOT}/Sdk-0.9.5)
 else ()
--- a/NEWS	Wed Jul 20 13:01:30 2016 +0200
+++ b/NEWS	Wed Sep 07 09:13:53 2016 +0200
@@ -1,6 +1,8 @@
 Pending changes in the mainline
 ===============================
 
+* Performance warning if runtime debug assertions are turned on
+
 
 Version 2.2 (2016-06-28)
 ========================
--- a/Plugin/Plugin.cpp	Wed Jul 20 13:01:30 2016 +0200
+++ b/Plugin/Plugin.cpp	Wed Sep 07 09:13:53 2016 +0200
@@ -530,6 +530,14 @@
 }
 
 
+static bool DisplayPerformanceWarning()
+{
+  (void) DisplayPerformanceWarning;   // Disable warning about unused function
+  OrthancPluginLogWarning(context_, "Performance warning in Web viewer: "
+                          "Non-release build, runtime debug assertions are turned on");
+  return true;
+}
+
 
 extern "C"
 {
@@ -538,6 +546,7 @@
     using namespace OrthancPlugins;
 
     context_ = context;
+    assert(DisplayPerformanceWarning());
     OrthancPluginLogWarning(context_, "Initializing the Web viewer");