Opened 11 years ago

Closed 11 years ago

#5826 closed Bugs (fixed)

threads.cpp: resource leak on threads creation failure

Reported by: noloader@… Owned by: viboes
Milestone: Boost 1.49.0 Component: thread
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

There's a number of reasons a thread might fail to be created, especially on Windows CE. For example, specifying a SecurityAttributes structure or creating more than ~20 threads will result in thread creation failure.

Index: thread.cpp =================================================================== RCS file: /cvsroot/boost/boost/libs/thread/src/thread.cpp,v retrieving revision 1.25 diff -r1.25 thread.cpp 57a58

ThreadProxyData* data = new ThreadProxyData(start_address,arglist);

59,60c60,65 < new ThreadProxyData(start_address,arglist),initflag,&threadID); < if (hthread!=0) ---

data,initflag,&threadID);

if (hthread==0) {

delete data; return 0;

} if (thrdaddr!=0)

Change History (4)

comment:1 by Jeffrey Walton <noloader@…>, 11 years ago

Component: None → thread
Owner: set to Anthony Williams

comment:2 by viboes, 11 years ago

I will take care of it soon.

comment:3 by viboes, 11 years ago

Milestone: To Be Determined → Boost 1.49.0
Owner: changed from Anthony Williams to viboes
Status: new → assigned

Committed in trunk at #75860

comment:4 by viboes, 11 years ago

Resolution: → fixed
Status: assigned → closed

Committed in release at #76345

Note: See TracTickets for help on using tickets.