Re: How to write handwritten code to access the C++ object when the corresponding python object destroyed?

Weitian Leung <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CADp56LY9G312EGfHXffnCRn1G7fiVnLvm_pWwcp4kWHxmAxvYA@mail.gmail.com>
Did you mean the wrapped class destructor? It's not the case I want...

struct IDemo
> {
>     virtual void do_sth(BSTR bstr) = 0;
> };
>

The IDemo is created by other C++ interface, the correct way to pass the
bstr to *do_sth *is call *SysAllocString*,
and after the call returned, we need call *SysFreeString* to free the bstr.
Because the IDemo instance will not take over the ownership of the bstr.

So when mapped the BSTR to str, it seems that we don't have any chance to
call the *SysFreeString *to free the str that allocated inside
*%ConvertToTypeCode.*



On Thu, Feb 20, 2020 at 5:07 PM Phil Thompson <[email protected]>
wrote:

> I meant the C++ destructor, not __dtor__.
>
> Phil
>

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.