Skip to content

Commit ef739b8

Browse files
authored
Merge pull request #647 from iakov/master
Fix usage of free'd ModelTimer object
2 parents f1fcf0a + bae5915 commit ef739b8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

plugins/robots/interpreters/trikKitInterpreterCommon/src/trikbrick.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,9 @@ void TrikBrick::wait(int milliseconds)
376376

377377
QEventLoop loop;
378378

379-
QScopedPointer<utils::AbstractTimer> t(timeline->produceTimer());
380-
connect(t.data(), &utils::AbstractTimer::timeout, &loop, &QEventLoop::quit);
379+
auto t = timeline->produceTimer();
380+
connect(t, &utils::AbstractTimer::timeout, &loop, &QEventLoop::quit);
381+
connect(&loop, &QObject::destroyed, t, &QObject::deleteLater);
381382

382383
// This one is from brick.reset(), that is called for toolbar Stop button
383384
connect(this, &TrikBrick::stopWaiting, &loop, &QEventLoop::quit);

qrtranslations/fr/plugins/robots/trikKitInterpreterCommon_fr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@
105105
</message>
106106
<message>
107107
<location line="-30"/>
108-
<location line="+285"/>
108+
<location line="+286"/>
109109
<source>Trying to read from file %1 failed</source>
110110
<translation type="unfinished"></translation>
111111
</message>
112112
<message>
113-
<location line="-230"/>
113+
<location line="-231"/>
114114
<source>No configured motor on port: %1</source>
115115
<translation type="unfinished"></translation>
116116
</message>

qrtranslations/ru/plugins/robots/trikKitInterpreterCommon_ru.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@
165165
</message>
166166
<message>
167167
<location line="-30"/>
168-
<location line="+285"/>
168+
<location line="+286"/>
169169
<source>Trying to read from file %1 failed</source>
170170
<translation>Не удалось открыть файл %1</translation>
171171
</message>
172172
<message>
173-
<location line="-230"/>
173+
<location line="-231"/>
174174
<source>No configured motor on port: %1</source>
175175
<translation>Не найден сконфигурированный мотор на порту: %1</translation>
176176
</message>

0 commit comments

Comments
 (0)