summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-30 14:13:44 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-31 13:38:30 +0000
commit5e042a1bcd236737b99781e2d5f3a601df4baedc (patch)
tree21030206a45f59e0096b36bc4edf98d8adf9a70f /fpdfsdk
parent26cb2fa42b1a90146f9ab5c0b83ee8b48703baf4 (diff)
downloadpdfium-5e042a1bcd236737b99781e2d5f3a601df4baedc.tar.xz
Fix OnDestroy method for scroll bars
Bug: 727048 Change-Id: Ib2ce898eeb814f17fca852bcf670678f734d905f Reviewed-on: https://pdfium-review.googlesource.com/6083 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp11
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 1c3efb1faa..36ee5c762f 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -575,6 +575,17 @@ void CPWL_ScrollBar::OnCreate(PWL_CREATEPARAM& cp) {
cp.eCursorType = FXCT_ARROW;
}
+void CPWL_ScrollBar::OnDestroy() {
+ // Until cleanup takes place in the virtual destructor for CPWL_Wnd
+ // subclasses, implement the virtual OnDestroy method that does the
+ // cleanup first, then invokes the superclass OnDestroy ... gee,
+ // like a dtor would.
+ m_pMinButton.Release();
+ m_pMaxButton.Release();
+ m_pPosButton.Release();
+ CPWL_Wnd::OnDestroy();
+}
+
void CPWL_ScrollBar::RePosChildWnd() {
CFX_FloatRect rcClient = GetClientRect();
CFX_FloatRect rcMinButton, rcMaxButton;
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
index 41df6550e0..165d0e022c 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
@@ -124,6 +124,7 @@ class CPWL_ScrollBar : public CPWL_Wnd {
// CPWL_Wnd
CFX_ByteString GetClassName() const override;
void OnCreate(PWL_CREATEPARAM& cp) override;
+ void OnDestroy() override;
void RePosChildWnd() override;
void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
void DrawThisAppearance(CFX_RenderDevice* pDevice,