mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 04:44:25 -04:00
fixed mismatched free/delete (free is used in rschatitems.cc to delete avatars)
This commit is contained in:
parent
8e7e70035a
commit
fb7ac7a8f6
1 changed files with 3 additions and 3 deletions
|
@ -146,7 +146,7 @@ class p3ChatService::AvatarInfo
|
||||||
|
|
||||||
~AvatarInfo()
|
~AvatarInfo()
|
||||||
{
|
{
|
||||||
delete[] _image_data ;
|
free( _image_data );
|
||||||
_image_data = NULL ;
|
_image_data = NULL ;
|
||||||
_image_size = 0 ;
|
_image_size = 0 ;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ class p3ChatService::AvatarInfo
|
||||||
void init(const unsigned char *jpeg_data,int size)
|
void init(const unsigned char *jpeg_data,int size)
|
||||||
{
|
{
|
||||||
_image_size = size ;
|
_image_size = size ;
|
||||||
_image_data = new unsigned char[size] ;
|
_image_data = (unsigned char*)rs_malloc(size) ;
|
||||||
memcpy(_image_data,jpeg_data,size) ;
|
memcpy(_image_data,jpeg_data,size) ;
|
||||||
}
|
}
|
||||||
AvatarInfo(const unsigned char *jpeg_data,int size)
|
AvatarInfo(const unsigned char *jpeg_data,int size)
|
||||||
|
@ -169,7 +169,7 @@ class p3ChatService::AvatarInfo
|
||||||
|
|
||||||
void toUnsignedChar(unsigned char *& data,uint32_t& size) const
|
void toUnsignedChar(unsigned char *& data,uint32_t& size) const
|
||||||
{
|
{
|
||||||
data = new unsigned char[_image_size] ;
|
data = (unsigned char *)rs_malloc(_image_size) ;
|
||||||
size = _image_size ;
|
size = _image_size ;
|
||||||
memcpy(data,_image_data,size*sizeof(unsigned char)) ;
|
memcpy(data,_image_data,size*sizeof(unsigned char)) ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue