[Libreoffice-bugs] [Bug 122688] New: Introduce reference counting for HDC

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun Jan 13 11:24:16 UTC 2019


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: libreoffice-bugs at lists.freedesktop.org
          Reporter: dshil at fastmail.com

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190113/1ea6f7ea/attachment-0001.html>


More information about the Libreoffice-bugs mailing list