summaryrefslogtreecommitdiff
path: root/support/dktools/DkClockApp.cpt
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
committerNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
commit1f457376b478257b88d4a857f5ec1b6155442dd7 (patch)
tree2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/DkClockApp.cpt
parentac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff)
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/DkClockApp.cpt')
-rw-r--r--support/dktools/DkClockApp.cpt56
1 files changed, 49 insertions, 7 deletions
diff --git a/support/dktools/DkClockApp.cpt b/support/dktools/DkClockApp.cpt
index 307d8e776e..7051c5cfb0 100644
--- a/support/dktools/DkClockApp.cpt
+++ b/support/dktools/DkClockApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -51,12 +51,18 @@ class DkClockApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkClockApp);
+#else
DECLARE_APP(DkClockApp)
+#endif
%% module
+#include "dk3conf.h"
#include "wxdkclock.h"
@@ -233,7 +239,7 @@ wxdkclock.htb
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -268,7 +274,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkClockApp);
+#else
IMPLEMENT_APP(DkClockApp)
+#endif
bool
@@ -279,7 +290,7 @@ DkClockApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchiveFs = NULL;
bool back = false;
#if USE_WXAPP_ONINIT
@@ -308,6 +319,14 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -315,6 +334,14 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -322,14 +349,29 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchiveFs = new wxArchiveFSHandler();
+ if (NULL != phArchiveFs) {
+ wxFileSystem::AddHandler(phArchiveFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
localizedTexts = pHelper->getStringTable(
wxdkclock_texts, wxdkclock_nl_dk[1]
);
@@ -355,8 +397,8 @@ DkClockApp::OnInit()
wxdkclock_nl_dk
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */