2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

Destroy InputField::Inner before InputField.

Inner has a pointer to parent and uses it assuming it is InputField.
If Inner lives longer than InputField (till ~QWidget) then in some
cases it accesses InputField as a (not completely) destroyed object.
This commit is contained in:
John Preston
2018-07-18 22:22:07 +03:00
parent c48937a2f5
commit ffd2817d18
2 changed files with 14 additions and 8 deletions

View File

@@ -297,6 +297,8 @@ public:
int scrollTopMax() const;
void scrollTo(int top);
~InputField();
private slots:
void onTouchTimer();
@@ -413,7 +415,7 @@ private:
bool _forcePlaceholderHidden = false;
bool _reverseMarkdownReplacement = false;
object_ptr<Inner> _inner;
const std::unique_ptr<Inner> _inner;
TextWithTags _lastTextWithTags;
std::vector<MarkdownTag> _lastMarkdownTags;