gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9678: Don't use std::swap, it ap


From: Bastiaan Jacques
Subject: Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9678: Don't use std::swap, it appears to corrupt the data.
Date: Sat, 1 Nov 2008 12:00:47 -0700 (PDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

What this code used to do was transfer the ownership of the pointer
contained in tmp (i.e., NULL) to _data and vice versa. So after swap(),
_data would contain no data. (Presumably this is the corruption
mentioned.)

What the code now does is that _data takes ownership of a newly
allocated buffer, so even if one were to use the temporary scoped_array
called tmp, there would be little point to it.

Bastiaan


On Sat, 1 Nov 2008, address@hidden wrote:

 Don't use std::swap, it appears to corrupt the data.
modified:


-       tmp.swap(_data);
+//     tmp.swap(_data);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]