From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6895 invoked by alias); 19 Jul 2002 16:46:30 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 6888 invoked from network); 19 Jul 2002 16:46:29 -0000 Received: from unknown (HELO relay.intrinsic.com) (206.135.194.85) by sources.redhat.com with SMTP; 19 Jul 2002 16:46:29 -0000 Received: from toulouse (toulouse [10.0.4.132]) by relay.intrinsic.com (8.9.3/8.9.3) with SMTP id JAA07621 for ; Fri, 19 Jul 2002 09:46:29 -0700 Message-ID: <009801c22f44$31b67d40$8404000a@toulouse> From: "Axel Mamode" To: References: <5.1.0.14.0.20020716095023.030d1928@pop.tiscalinet.it> Subject: leak from main thread Date: Fri, 19 Jul 2002 09:46:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-SW-Source: 2002/txt/msg00083.txt.bz2 I know that this is not the intended usage of the pthread library (as it uses pthread for the main thread), but the following program leaks two blocks of memory (with pthreads-snap-2002-03-02): #include #include int main() { // turn on leak detection int dbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); dbgFlag |= _CRTDBG_LEAK_CHECK_DF; _CrtSetDbgFlag(dbgFlag); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); return 0; } Supposedly, the setcancelstate creates a mutex that is never freed (the equivalent mutex is freed though when a posix thread exits). -- Axel Mamode