Browse Source

TokenizeResult assignment/move operators now free old buffers (memory leak fix).

release/0.19
JustinAJ 9 years ago
parent
commit
028982479e
  1. 6
      Jupiter/Readable_String_Imp.h
  2. BIN
      Release/Jupiter.lib

6
Jupiter/Readable_String_Imp.h

@ -1357,6 +1357,9 @@ template<typename T> template<template<typename> class R> const R<T> &Jupiter::R
template<typename T> template<template<typename> class R> inline typename Jupiter::Readable_String<T>::TokenizeResult<R> &Jupiter::Readable_String<T>::TokenizeResult<R>::operator=(typename const Jupiter::Readable_String<T>::TokenizeResult<R> &right)
{
if (Jupiter::Readable_String<T>::TokenizeResult<R>::tokens != nullptr)
delete[] Jupiter::Readable_String<T>::TokenizeResult<R>::tokens;
Jupiter::Readable_String<T>::TokenizeResult<R>::tokens = new R<T>[source.token_count];
Jupiter::Readable_String<T>::TokenizeResult<R>::token_count = 0;
while (Jupiter::Readable_String<T>::TokenizeResult<R>::token_count != source.token_count)
@ -1369,6 +1372,9 @@ template<typename T> template<template<typename> class R> inline typename Jupite
template<typename T> template<template<typename> class R> inline typename Jupiter::Readable_String<T>::TokenizeResult<R> &Jupiter::Readable_String<T>::TokenizeResult<R>::operator=(typename Jupiter::Readable_String<T>::TokenizeResult<R> &&right)
{
if (Jupiter::Readable_String<T>::TokenizeResult<R>::tokens != nullptr)
delete[] Jupiter::Readable_String<T>::TokenizeResult<R>::tokens;
Jupiter::Readable_String<T>::TokenizeResult<R>::tokens = source.tokens;
Jupiter::Readable_String<T>::TokenizeResult<R>::token_count = source.token_count;
source.tokens = nullptr;

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save