summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
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,