You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2010/01/27 14:57:32 UTC

[jira] Commented: (AMQCPP-282) deletion of pointer to incomplete type 'decaf::lang::ThreadProperties'; no destructor called

    [ https://issues.apache.org/activemq/browse/AMQCPP-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57169#action_57169 ] 

Timothy Bish commented on AMQCPP-282:
-------------------------------------

Exposing the implementation in the Header means we can't implement this solution as changes to the platform specific implementations of these data structure would then break ABI unnecessarily.  

It appears that these warnings can be ignored on Windows and the implementation of Pointer works with the GCC compiler to allow the correct destructor to be called on non-windows platforms.

> deletion of pointer to incomplete type 'decaf::lang::ThreadProperties'; no destructor called
> --------------------------------------------------------------------------------------------
>
>                 Key: AMQCPP-282
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-282
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: Visual Studio 2008 SP1 on Win32 (Windows Server 2003 R2, 32-bit)
>            Reporter: Ivan Pechorin
>            Assignee: Timothy Bish
>         Attachments: MSVC_C4150.diff
>
>
> ActiveMQ C++ client gives the C4150 warning "deletion of pointer to incomplete type; no destructor called" multiple times when compiling it with Visual C++ 2008 SP1 on Win32.
> There are two different places that generate this warning:
> 1) decaf::lang::ThreadProperties
> 1>SimpleLogger.cpp
> 1>c:\dev_vc9\activemq\activemq-cpp-trunk\src\main\decaf/lang/Pointer.h(358) : warning C4150: deletion of pointer to incomplete type 'decaf::lang::ThreadProperties'; no destructor called
> 1>        c:\dev_vc9\activemq\activemq-cpp-trunk\src\main\decaf/lang/Thread.h(39) : see declaration of 'decaf::lang::ThreadProperties'
> 1>        c:\dev_vc9\activemq\activemq-cpp-trunk\src\main\decaf/lang/Pointer.h(357) : while compiling class template member function 'void decaf::lang::Pointer<T>::onDeleteFunc(T *)'
> 1>        with
> 1>        [
> 1>            T=decaf::lang::ThreadProperties
> 1>        ]
> 1>        c:\dev_vc9\activemq\activemq-cpp-trunk\src\main\decaf/lang/Thread.h(73) : see reference to class template instantiation 'decaf::lang::Pointer<T>' being compiled
> 1>        with
> 1>        [
> 1>            T=decaf::lang::ThreadProperties
> 1>        ]
> 2) decaf::internal::RuntimeData
> 1>Thread.cpp
> 1>C:\tools\Microsoft Visual Studio 9.0\VC\include\memory(721) : warning C4150: deletion of pointer to incomplete type 'decaf::internal::RuntimeData'; no destructor called
> 1>        c:\dev_vc9\activemq\activemq-cpp-trunk\src\main\decaf/internal/DecafRuntime.h(30) : see declaration of 'decaf::internal::RuntimeData'
> 1>        C:\tools\Microsoft Visual Studio 9.0\VC\include\memory(720) : while compiling class template member function 'std::auto_ptr<_Ty>::~auto_ptr(void)'
> 1>        with
> 1>        [
> 1>            _Ty=decaf::internal::RuntimeData
> 1>        ]
> 1>        c:\dev_vc9\activemq\activemq-cpp-trunk\src\main\decaf/internal/DecafRuntime.h(38) : see reference to class template instantiation 'std::auto_ptr<_Ty>' being compiled
> 1>        with
> 1>        [
> 1>            _Ty=decaf::internal::RuntimeData
> 1>        ]
> The warning affects both version 3.1.0 and the trunk.
> I was able to resolve the warning by moving declarations of these two classes from the cpp files to the corresponding header files. I'm not proficient enough in C++ to provide solution that keeps these classes encapsulated.
> It is unlikely that these two particular warnings could lead to memory leaks on Win32:
>  - RuntimeData's only member  is managed from outside, destructor is trivial (empty); 
>  - ThreadProperties's destructor is trivial (empty) on Win32, and non-trivial on platforms with pthreads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.