https://bugs.documentfoundation.org/show_bug.cgi?id=122688
Bug ID: 122688
Summary: Introduce reference counting for HDC
Product: LibreOffice
Version: unspecified
Hardware: All
OS: Windows (All)
Status: UNCONFIRMED
Severity: minor
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
ScopedSelectedHPEN was introduced during the implementation of smart pointers
for various GDI objects [1], [2]. It uses the device context object, HDC, [3]
internally with an assumption that the HDC object will be valid during the
ScopedSelectedHPEN life time. This assumption was made because the entire
codebase is relied on this fact.
As discussed in [2] (refer to the Mike Kaganski's comments) it is better to
introduce some kind of SharedHDC based on std::shared_ptr and make
ScopedSelectedHPEN to use the SharedHDC instead of a raw pointer.
As a result the ScopedSelectedHPEN wouldn't require to know anything about the
lifetime of the device context.
1. https://bugs.documentfoundation.org/show_bug.cgi?id=107792
2. https://gerrit.libreoffice.org/#/c/65963/
3. https://docs.microsoft.com/en-us/windows/desktop/gdi/device-contexts
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs