fix memory leaks in MSVC generators
Change-Id: I11bfc8259ac4e175c9ecc37d64f1d2e5037f15aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
b088e4827f
commit
e1f89037c3
@ -44,6 +44,7 @@
|
|||||||
#include "msvc_objectmodel.h"
|
#include "msvc_objectmodel.h"
|
||||||
#include "msvc_vcproj.h"
|
#include "msvc_vcproj.h"
|
||||||
#include "msvc_vcxproj.h"
|
#include "msvc_vcxproj.h"
|
||||||
|
#include <qscopedpointer.h>
|
||||||
#include <qstringlist.h>
|
#include <qstringlist.h>
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
|
|
||||||
@ -1756,11 +1757,11 @@ void VCXProjectWriter::addFilters(VCProject &project, XmlOutput &xmlFilter, cons
|
|||||||
// outputs a given filter for all existing configurations of a project
|
// outputs a given filter for all existing configurations of a project
|
||||||
void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername)
|
void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername)
|
||||||
{
|
{
|
||||||
XNode *root;
|
QScopedPointer<XNode> root;
|
||||||
if (project.SingleProjects.at(0).flat_files)
|
if (project.SingleProjects.at(0).flat_files)
|
||||||
root = new XFlatNode;
|
root.reset(new XFlatNode);
|
||||||
else
|
else
|
||||||
root = new XTreeNode;
|
root.reset(new XTreeNode);
|
||||||
|
|
||||||
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
||||||
VCFilter filter;
|
VCFilter filter;
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "msvc_objectmodel.h"
|
#include "msvc_objectmodel.h"
|
||||||
#include "msvc_vcproj.h"
|
#include "msvc_vcproj.h"
|
||||||
#include "msvc_vcxproj.h"
|
#include "msvc_vcxproj.h"
|
||||||
|
#include <qscopedpointer.h>
|
||||||
#include <qstringlist.h>
|
#include <qstringlist.h>
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
|
|
||||||
@ -2854,11 +2855,11 @@ void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
|
|||||||
// outputs a given filter for all existing configurations of a project
|
// outputs a given filter for all existing configurations of a project
|
||||||
void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QString &filtername)
|
void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QString &filtername)
|
||||||
{
|
{
|
||||||
Node *root;
|
QScopedPointer<Node> root;
|
||||||
if (project.SingleProjects.at(0).flat_files)
|
if (project.SingleProjects.at(0).flat_files)
|
||||||
root = new FlatNode;
|
root.reset(new FlatNode);
|
||||||
else
|
else
|
||||||
root = new TreeNode;
|
root.reset(new TreeNode);
|
||||||
|
|
||||||
QString name, extfilter, guid;
|
QString name, extfilter, guid;
|
||||||
triState parse = unset;
|
triState parse = unset;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user