Skip to content

Commit

Permalink
Merge pull request #77 from deepskystacker/master
Browse files Browse the repository at this point in the history
Merge fix for non-beta build memory leak
  • Loading branch information
perdrix52 committed Jul 21, 2019
2 parents af57fe2 + 51d6675 commit 48cfbe8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion DeepSkyStacker/DeepSkyStacker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ BOOL CheckVersion(CString & strVersion)
#ifndef DSSBETA
CRegistry reg;
DWORD bCheckVersion = 0;
CStdioFile remotefile = nullptr;

reg.LoadKey(REGENTRY_BASEKEY, _T("InternetCheck"), bCheckVersion);
if (bCheckVersion == 2)
Expand All @@ -81,7 +82,7 @@ BOOL CheckVersion(CString & strVersion)
mysession.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 1);
mysession.SetOption(INTERNET_OPTION_RECEIVE_TIMEOUT, 1);

CStdioFile *remotefile = mysession.OpenURL(_T("http://deepskystacker.free.fr/download/CurrentVersion.txt"),1,INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_DONT_CACHE|INTERNET_FLAG_RELOAD);
remotefile = mysession.OpenURL(_T("http://deepskystacker.free.fr/download/CurrentVersion.txt"),1,INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_DONT_CACHE|INTERNET_FLAG_RELOAD);

int numbytes;

Expand All @@ -105,6 +106,7 @@ BOOL CheckVersion(CString & strVersion)
}
END_CATCH_ALL;
};
delete remotefile;
#endif

return bResult;
Expand Down
9 changes: 5 additions & 4 deletions DeepSkyStacker/EntropyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
void CEntropyInfo::InitSquareEntropies()
{
ZFUNCTRACE_RUNTIME();
LONG i, j;
LONG lSquareSize;

lSquareSize = m_lWindowSize * 2 + 1;
Expand All @@ -26,15 +25,18 @@ void CEntropyInfo::InitSquareEntropies()
if (m_pProgress)
m_pProgress->Start2(NULL, m_lNrSquaresX);

for (i = 0;i<m_lNrSquaresX;i++)
for (long i = 0;i<m_lNrSquaresX;i++)
{
LONG lMinX,
lMaxX;

lMinX = i * lSquareSize;
lMaxX = min((i+1) * lSquareSize -1, m_pBitmap->Width()-1);

for (j = 0;j<m_lNrSquaresY;j++)
#if defined(_OPENMP)
#pragma omp parallel for default(none)
#endif
for (long j = 0;j<m_lNrSquaresY;j++)
{
LONG lMinY,
lMaxY;
Expand All @@ -61,7 +63,6 @@ void CEntropyInfo::InitSquareEntropies()

void CEntropyInfo::ComputeEntropies(LONG lMinX, LONG lMinY, LONG lMaxX, LONG lMaxY, double & fRedEntropy, double & fGreenEntropy, double & fBlueEntropy)
{
ZFUNCTRACE_RUNTIME();
LONG i, j;
std::vector<WORD> vRedHisto;
std::vector<WORD> vGreenHisto;
Expand Down

0 comments on commit 48cfbe8

Please sign in to comment.