[vlmc-devel] [PATCH 2/2] Use delete[]
yikei lu
luyikei.qmltu at gmail.com
Sat Apr 2 11:40:17 CEST 2016
QSharedPointer or std::shared_ptr ?
2016-04-02 18:39 GMT+09:00 Hugo Beauzée-Luyssen <hugo at beauzee.fr>:
> On 04/02/2016 07:45 AM, Yikai Lu wrote:
>>
>> Since buff is created by new uchar[], delete[] should be used to delete it
>> completely.
>> ---
>> src/Workflow/AudioClipWorkflow.cpp | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/Workflow/AudioClipWorkflow.cpp
>> b/src/Workflow/AudioClipWorkflow.cpp
>> index 3b08877..c119c29 100644
>> --- a/src/Workflow/AudioClipWorkflow.cpp
>> +++ b/src/Workflow/AudioClipWorkflow.cpp
>> @@ -52,13 +52,13 @@ AudioClipWorkflow::releasePrealocated()
>> while ( m_availableBuffers.isEmpty() == false )
>> {
>> Workflow::AudioSample *as = m_availableBuffers.takeFirst();
>> - delete as->buff;
>> + delete[] as->buff;
>> delete as;
>> }
>> while ( m_computedBuffers.isEmpty() == false )
>> {
>> Workflow::AudioSample *as = m_computedBuffers.takeFirst();
>> - delete as->buff;
>> + delete[] as->buff;
>> delete as;
>> }
>> }
>>
> It might be time we start using some smart pointers for the buffers as well,
> we shouldn't have to deal with this manually IMHO
>
> _______________________________________________
> Vlmc-devel mailing list
> Vlmc-devel at videolan.org
> https://mailman.videolan.org/listinfo/vlmc-devel
More information about the Vlmc-devel
mailing list