Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for memory leaks and QObject* ownership bugs #201

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5c3d2f7
Fix for QObject* ownership bugs
412b May 20, 2015
7591602
added missed parents
412b May 24, 2015
ad91813
Merge remote-tracking branch 'upstream/master' into qt-qml-fixing-own…
412b May 24, 2015
f3b8e77
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
d04434e
added missing destructors
412b May 28, 2015
43dd963
fixing leaks
412b May 28, 2015
2b46f13
ownership, concurrency and and destructor for parser backend manager and
412b May 28, 2015
7b97514
clearJourney() is a more proper name
412b May 31, 2015
3b16f28
adding clearJourney to EFA parser
412b May 31, 2015
32243d8
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
cf3ad03
one more small fix to vasttrafikse
412b May 31, 2015
486eb79
fixing ninetwo memory leaks
412b May 31, 2015
52a8675
fixing resrobot memory leaks
412b May 31, 2015
8741cfa
providing clearJourney at the top level
412b May 31, 2015
12260d3
Fix for QObject* ownership bugs
412b May 20, 2015
c01f35f
added missed parents
412b May 24, 2015
90dc51c
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
491f62f
added missing destructors
412b May 28, 2015
1c97540
fixing leaks
412b May 28, 2015
ca2363e
ownership, concurrency and and destructor for parser backend manager and
412b May 28, 2015
6ab36b3
clearJourney() is a more proper name
412b May 31, 2015
f564acb
adding clearJourney to EFA parser
412b May 31, 2015
4e9d150
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
88e23bd
one more small fix to vasttrafikse
412b May 31, 2015
7f7411d
fixing ninetwo memory leaks
412b May 31, 2015
ae0c3f5
fixing resrobot memory leaks
412b May 31, 2015
9578c88
providing clearJourney at the top level
412b May 31, 2015
17bc132
added missed parents
412b May 24, 2015
a8d240c
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
253877b
fixing leaks
412b May 28, 2015
bb6c564
clearJourney() is a more proper name
412b May 31, 2015
c766afa
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
d2be213
one more small fix to vasttrafikse
412b May 31, 2015
26a0b54
Merge branch 'qt-qml-fixing-ownership-rebased' of github.com:412b/
412b Jun 1, 2015
adff4e2
Fix for QObject* ownership bugs
412b May 20, 2015
b3a2b76
added missed parents
412b May 24, 2015
98201ac
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
35db43b
added missing destructors
412b May 28, 2015
bfdeedc
fixing leaks
412b May 28, 2015
02eff80
ownership, concurrency and and destructor for parser backend manager and
412b May 28, 2015
95604c5
clearJourney() is a more proper name
412b May 31, 2015
2cea328
adding clearJourney to EFA parser
412b May 31, 2015
bc82fa0
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
9076fb0
one more small fix to vasttrafikse
412b May 31, 2015
3a00949
fixing ninetwo memory leaks
412b May 31, 2015
420764f
fixing resrobot memory leaks
412b May 31, 2015
fe93c97
providing clearJourney at the top level
412b May 31, 2015
57a638d
added missed parents
412b May 24, 2015
42c88a8
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
a43589c
fixing leaks
412b May 28, 2015
92be2e1
clearJourney() is a more proper name
412b May 31, 2015
ea6fcbb
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
4897391
one more small fix to vasttrafikse
412b May 31, 2015
6930cf9
upstreaming
Jun 13, 2015
c301e1d
Merge branch 'qt-qml-fixing-ownership-rebased' of github.com:412b/fah…
412b Jun 13, 2015
1a1eb14
added clear journey api to be able to free memory as soon as possible
412b Jun 13, 2015
208ad3e
additional control on destruction
412b Jun 13, 2015
ab694db
Merge remote-tracking branch 'refs/remotes/upstream/master' into qt-q…
412b Jun 13, 2015
6ab413e
minor ownership fixes and memory leak fixes
412b Jun 19, 2015
4db74e8
cleaning up lastJourneyResultList initialization in ctors
412b Jun 19, 2015
16fc039
finalizing cleanups and fixes
412b Jun 19, 2015
0479942
ensure calling clearJourney() in all the paths (search, search earlier,
412b Jun 23, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rpm/harbour-fahrplan2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ PkgConfigBR:
- Qt5Quick
- Qt5Qml
- Qt5Core
- sailfishapp
Requires:
- sailfishsilica-qt5 >= 0.10.9
- qt5-qtdeclarative-import-positioning
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my guess is, this also auto installs the position lib in emulator.
Only worry is, that this also get catched by harbour store validator :) (as far as i know using gps is still against the harbour rules)

If you have any insights on this, or should we wait and see? :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this change relevant to QObject ownership change at all?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that change got there by mistake mostly, but w/o it you can not run it in emu w/o manually installing packages. it can also affect users, which have no positioning dependant apps installed (if that is possible at all :))
that said, that change can be undone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files:
- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png'
- '%{_datadir}/applications/%{name}.desktop'
Expand Down
9 changes: 9 additions & 0 deletions src/parser/parser_definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ void JourneyResultList::setTimeInfo(const QString &timeInfo)
}

//------------- JourneyResultItem
JourneyResultItem::JourneyResultItem(QObject *parent) : QObject(parent)
{

}

QString JourneyResultItem::id() const
{
Expand Down Expand Up @@ -327,6 +331,11 @@ void JourneyDetailResultList::setDuration(const QString &duration)

//------------- JourneyDetailResultItem

JourneyDetailResultItem::JourneyDetailResultItem(QObject *parent) : QObject(parent)
{

}

QString JourneyDetailResultItem::departureStation() const
{
return m_departureStation;
Expand Down
2 changes: 2 additions & 0 deletions src/parser/parser_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class JourneyResultItem : public QObject
Q_PROPERTY(QString internalData2 READ internalData2 WRITE setInternalData2)

public:
explicit JourneyResultItem(QObject * parent = 0);
QString id() const;
void setId(const QString &);
QDate date() const;
Expand Down Expand Up @@ -176,6 +177,7 @@ class JourneyDetailResultItem : public QObject
Q_PROPERTY(QString internalData1 READ internalData1 WRITE setInternalData1)
Q_PROPERTY(QString internalData2 READ internalData2 WRITE setInternalData2)
public:
explicit JourneyDetailResultItem(QObject * parent = 0);
QString departureStation() const;
void setDepartureStation(const QString &);
QString departureInfo() const;
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parser_efa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void ParserEFA::parseSearchJourney(QNetworkReply *networkReply)
info = tr("Guaranteed connection");
}
motNameList.append(motName);
JourneyDetailResultItem *jdrItem = new JourneyDetailResultItem();
JourneyDetailResultItem *jdrItem = new JourneyDetailResultItem(detailsList);
jdrItem->setTrain(motName);
jdrItem->setInfo(info);
jdrItem->setDirection(motElement.attribute("destination"));
Expand Down Expand Up @@ -580,7 +580,7 @@ void ParserEFA::parseSearchJourney(QNetworkReply *networkReply)
detailsList->setDepartureDateTime(departureDateTime);
cachedJourneyDetailsEfa[id] = detailsList;

JourneyResultItem *item = new JourneyResultItem();
JourneyResultItem *item = new JourneyResultItem(lastJourneyResultList);
item->setDate(departureDateTime.date());
item->setId(id);
item->setTransfers(changes);
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parser_hafasbinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void ParserHafasBinary::parseSearchJourney(QNetworkReply *networkReply)

for (int iPart = 0; iPart < numParts; iPart++) {

JourneyDetailResultItem *inlineItem = new JourneyDetailResultItem();
JourneyDetailResultItem *inlineItem = new JourneyDetailResultItem(inlineResults);

hafasData.device()->seek(0x4a + partsOffset + iPart * 20);

Expand Down Expand Up @@ -571,7 +571,7 @@ void ParserHafasBinary::parseSearchJourney(QNetworkReply *networkReply)

lineNames.removeDuplicates();

JourneyResultItem *item = new JourneyResultItem();
JourneyResultItem *item = new JourneyResultItem(lastJourneyResultList);
item->setDate(journeyDate);
item->setId(connectionId);
item->setTransfers(QString::number(numChanges));
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parser_hafasxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ void ParserHafasXml::parseSearchJourney(QNetworkReply *networkReply)

const QDomNodeList connections = doc.elementsByTagName("Connection");
for (int i = 0; i < connections.count(); ++i) {
JourneyResultItem *item = new JourneyResultItem();
JourneyResultItem *item = new JourneyResultItem(lastJourneyResultList);
item->setId(connections.at(i).toElement().attribute("id").trimmed());

QDomElement overview = connections.at(i).firstChildElement("Overview");
Expand Down Expand Up @@ -846,7 +846,7 @@ JourneyDetailResultList* ParserHafasXml::internalParseJourneyDetails(const QDomE

const QDomNodeList sections = connection.elementsByTagName("ConSection");
for (int i = 0; i < sections.count(); ++i) {
JourneyDetailResultItem *item = new JourneyDetailResultItem();
JourneyDetailResultItem *item = new JourneyDetailResultItem(results);

const QDomNode section = sections.at(i);
QDomElement stop;
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parser_xmlvasttrafikse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void ParserXmlVasttrafikSe::parseSearchJourney(QNetworkReply *networkReply)
if (doc.setContent(xmlRawtext, false)) {
QDomNodeList tripNodeList = doc.elementsByTagName("Trip");
for (unsigned int i = 0; i < tripNodeList.length(); ++i) {
JourneyResultItem *jritem = new JourneyResultItem();
JourneyResultItem *jritem = new JourneyResultItem(journeyResultList);
JourneyDetailResultList *detailsList = new JourneyDetailResultList();

/// Set default values for journey's start and end time
Expand Down Expand Up @@ -367,7 +367,7 @@ void ParserXmlVasttrafikSe::parseSearchJourney(QNetworkReply *networkReply)
trainTypes.append(i18nConnectionType(getAttribute(legNode, "name")));
}

JourneyDetailResultItem *jdrItem = new JourneyDetailResultItem();
JourneyDetailResultItem *jdrItem = new JourneyDetailResultItem(detailsList);
jdrItem->setDepartureStation(getAttribute(originNode, "name"));
const QString depTrack = getAttribute(originNode, "track");
jdrItem->setDepartureInfo(depTrack.isEmpty() ? QChar(0x2014) : tr("Track %1").arg(depTrack));
Expand Down