Kaydet (Commit) c240c73c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove mis-optimization

Assume thread t1 creates OUString s, then spawns thread t2, then t2 acquires s,
then t2 signals via a channel that does not necessarily involve memory
synchronization (e.g., writes a byte into a pipe which t1 reads), then t1
releases s and can still see a refCount of 1 instead of 2.

Change-Id: I31047a1a6cc8fccc401a87849f5c3cee3642d803
üst 15003612
......@@ -1103,8 +1103,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis )
}
#endif
if ( pThis->refCount == 1 ||
!osl_atomic_decrement( &(pThis->refCount) ) )
if ( !osl_atomic_decrement( &(pThis->refCount) ) )
{
RTL_LOG_STRING_DELETE( pThis );
rtl_freeMemory( pThis );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment