From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16282 invoked by alias); 17 Nov 2010 07:39:03 -0000 Received: (qmail 16274 invoked by uid 22791); 17 Nov 2010 07:39:01 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Nov 2010 07:38:57 +0000 From: "internet at 123gen dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/46455] resource leaks due to missing destructors for mutexes and condvars X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: internet at 123gen dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 17 Nov 2010 07:42:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-11/txt/msg02162.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46455 --- Comment #29 from Zouzou 2010-11-17 07:38:39 UTC --- (In reply to comment #28) > Created attachment 22427 [details] > add destructors in > almost the same as the last patch but the destructor calls: > _S_destroy<__gthread_recursive_mutex_t>(&_M_mutex, 0); different error this time: In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/memory:78:0, from test.cpp:15: c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ext/concurrence.h: In static member function 'static int __gnu_cxx::__recursive_mutex::_S_destroy(_Rm*, typename __gnu_cxx::__recursive_mutex::_Detect_win32<_Rm, (& _Rm:: sema)>::type*) [with _Rm = __gthread_recursive_mutex_t, typename __gnu_cxx::__recursive_mutex::_Detect_win32<_Rm, (& _Rm:: sema)>::type = __gthread_mutex_t]': c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ext/concurrence.h:224:54: instantiated from here c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ext/concurrence.h:267:46: error: void value not ignored as it ought to be because __gthread_mutex_destroy returns void. after changing the return types of the _S_destroy functions to void and removing the "return" specifiers, the test case compiles and runs fine without any leak.