QXRD  0.11.16
Functions
qxrd.cpp File Reference

(Commit a65ccc9... : jennings : 2016-03-15 14:00:18 -0500)

#include "qxrddebug.h"
#include <QApplication>
#include "qxrdapplication.h"
#include "qxrdapplication-ptr.h"
#include "qxrdwindow.h"
#include "qxrdsplashscreen.h"
#include "qxrdsplashscreen-ptr.h"
#include <stdio.h>
#include <QSplashScreen>
#include "qcepdataobject.h"
Include dependency graph for qxrd.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 26 of file qxrd.cpp.

References QcepAllocator::allocatedMemory(), QcepObject::allocatedObjects(), QcepDataObject::allocatedObjects(), QcepObject::allocatedObjectsSet(), DEBUG_APP, DEBUG_EXITWAIT, QcepObject::deletedObjects(), QcepDataObject::deletedObjects(), g_DebugLevel, and qcepDebug().

27 {
28 #if defined(Q_OS_UNIX) && !defined(Q_OS_MACX)
29  mtrace();
30 #endif
31 
32  g_DebugLevel = QSharedPointer<QxrdDebugDictionary>(new QxrdDebugDictionary());
33 
34  if (qcepDebug(DEBUG_APP)) {
35  printf("App starts\n");
36  }
37 
38  int res = 0;
39 
40  {
42  new QxrdApplication(argc, argv));
43 
44  if (app->init(app, argc, argv)) {
45  if (app->get_GuiWanted()) {
46  res = app->exec();
47  } else {
48  app->processEvents();
49  app->exit();
50  }
51 
53  while(1) {}
54  }
55  }
56  }
57 
58  if (qcepDebug(DEBUG_APP)) {
59  printf("App finishes\n");
60  }
61 
62  int nObjAlloc = QcepObject::allocatedObjects();
63  int nObjDeleted = QcepObject::deletedObjects();
64 
65  int nDataAlloc = QcepDataObject::allocatedObjects();
66  int nDataDeleted = QcepDataObject::deletedObjects();
67 
68  quint64 allocated = QcepAllocator::allocatedMemory();
69 
70 #ifdef QT_NO_DEBUG
71  bool printIt = (nObjAlloc != nObjDeleted) || (nDataAlloc != nDataDeleted) || (allocated != 0);
72 #else
73  bool printIt = true;
74 #endif
75 
76  if (printIt) {
77  printf("%d objects allocated\n", nObjAlloc);
78  printf("%d objects deleted\n", nObjDeleted);
79  printf("%d objects leaked\n", nObjAlloc - nObjDeleted);
80 
81  printf("%d data objects allocated\n", nDataAlloc);
82  printf("%d data objects deleted\n", nDataDeleted);
83  printf("%d data objects leaked\n", nDataAlloc - nDataDeleted);
84 
85  printf("%Ld bytes still allocated\n", allocated);
86  }
87 
88 #ifndef QT_NO_DEBUG
89  if (nObjAlloc != nObjDeleted) {
90  int i=0;
92  printf("%d : %s\n", i++, qPrintable(obj->objectName()));
93  }
94  }
95 #endif
96 
97  return res;
98 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
static quint64 allocatedMemory()
static int deletedObjects()
static int deletedObjects()
Definition: qcepobject.cpp:55
static int allocatedObjects()
static QSet< QcepObject * > allocatedObjectsSet()
Definition: qcepobject.cpp:61
QSharedPointer< QcepDebugDictionary > g_DebugLevel
Definition: qcepdebug.cpp:4
static int allocatedObjects()
Definition: qcepobject.cpp:50
QSharedPointer< QxrdApplication > QxrdApplicationPtr

Here is the call graph for this function: