This leads to a minor code simplification.
Details
- Reviewers
tobiasdeiminger - Group Reviewers
Okular - Commits
- R223:b763bdba7aae: Simplify memory management of two private data members
There should be no functional changes caused by this patch.
Diff Detail
- Repository
- R223 Okular
- Lint
Lint Skipped - Unit
Unit Tests Skipped
ui/pageviewannotator.cpp | ||
---|---|---|
304 | +1 for automatic memory management. But is there a reason to not just say QPixmap pixmap; ? From top of my head, QPixmap is already a small handle to implicitly shared COW pixmap data. So, no need to wrap it again. |
ui/pageviewannotator.cpp | ||
---|---|---|
515 | This assumes m_pageView->textSelectionForItem transfers ownership for the returned RegularAreaRect*. That's actually true, but we can only tell it by looking at the code inside TextPage::textArea. Would be nice if we could make ownership explicit throughout the call chain. But I'm afraid it's problematic because TextPage::textArea is part of public interface and we don't want to change it? If you can't change it, just go on. It's not a problem introduced by your patch but already existed before. |
ui/pageviewannotator.cpp | ||
---|---|---|
515 |
Agreed
Not sure. But I'd rather leave that to a separate diff. |