mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
fix some memory leaks
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3012 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -65,6 +65,10 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q
|
|||||||
Destructor
|
Destructor
|
||||||
*/
|
*/
|
||||||
ElementsCollectionCache::~ElementsCollectionCache() {
|
ElementsCollectionCache::~ElementsCollectionCache() {
|
||||||
|
delete select_name_;
|
||||||
|
delete select_pixmap_;
|
||||||
|
delete insert_name_;
|
||||||
|
delete insert_pixmap_;
|
||||||
cache_db_.close();
|
cache_db_.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -433,14 +433,18 @@ TitleBlockTemplatesCollection *QETApp::titleBlockTemplatesCollection(const QStri
|
|||||||
*/
|
*/
|
||||||
QString QETApp::userName() {
|
QString QETApp::userName() {
|
||||||
QProcess * process = new QProcess();
|
QProcess * process = new QProcess();
|
||||||
|
QString str;
|
||||||
#ifndef Q_OS_WIN32
|
#ifndef Q_OS_WIN32
|
||||||
// return(QString(getenv("USER")));
|
// return(QString(getenv("USER")));
|
||||||
return((process->processEnvironment()).value("USER", "UNKNOWN"));
|
str = (process->processEnvironment()).value("USER", "UNKNOWN");
|
||||||
|
delete process;
|
||||||
|
return(str);
|
||||||
#else
|
#else
|
||||||
// return(QString(getenv("USERNAME")));
|
// return(QString(getenv("USERNAME")));
|
||||||
return((process->processEnvironment()).value("USERNAME", "UNKNOWN"));
|
str = (process->processEnvironment()).value("USERNAME", "UNKNOWN");
|
||||||
#endif
|
|
||||||
delete process;
|
delete process;
|
||||||
|
return(str);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -210,6 +210,11 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) {
|
|||||||
Destructeur
|
Destructeur
|
||||||
*/
|
*/
|
||||||
CustomElement::~CustomElement() {
|
CustomElement::~CustomElement() {
|
||||||
|
qDeleteAll (list_lines_);
|
||||||
|
qDeleteAll (list_rectangles_);
|
||||||
|
qDeleteAll (list_circles_);
|
||||||
|
qDeleteAll (list_polygons_);
|
||||||
|
qDeleteAll (list_arcs_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return la liste des bornes de cet element
|
/// @return la liste des bornes de cet element
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ void RecentFiles::buildMenu() {
|
|||||||
// remplit le menu
|
// remplit le menu
|
||||||
foreach (QString filepath, list_) {
|
foreach (QString filepath, list_) {
|
||||||
// creee une nouvelle action pour le fichier
|
// creee une nouvelle action pour le fichier
|
||||||
QAction *action = new QAction(filepath, 0);
|
QAction *action = new QAction(filepath, this);
|
||||||
if (!files_icon_.isNull()) {
|
if (!files_icon_.isNull()) {
|
||||||
action -> setIcon(files_icon_);
|
action -> setIcon(files_icon_);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user