Ken Takata wrote:
> Hi mattn,
>
> 2016/2/26 Fri 16:37:01 UTC+9 mattn wrote:
> > gui_dwrite.cpp:348:13: warning: deleting object of polymorphic class type
> > 'GdiTextRenderer' which has non-virtual destructor might cause undefined
> > behaviour [-Wdelete-non-virtual-dtor]
> > delete this;
> >
> > Below is a patch.
> >
> > diff --git a/src/gui_dwrite.cpp b/src/gui_dwrite.cpp
> > index 08b81c4..52de208 100644
> > --- a/src/gui_dwrite.cpp
> > +++ b/src/gui_dwrite.cpp
> > @@ -237,7 +237,7 @@ public:
> > AddRef();
> > }
> >
> > - ~GdiTextRenderer()
> > + virtual ~GdiTextRenderer()
> > {
> > SafeRelease(&pRenderTarget_);
> > SafeRelease(&pRenderingParams_);
>
> Another option is using "final" specifier as I already posted:
> https://groups.google.com/d/msg/vim_dev/ZnGSvwOJZ_4/op_lUvpXEAAJ
The solution with "virtual" is a lot shorter. And it doesn't require
C++11.
--
How do you know when you have run out of invisible ink?
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.