Skip to content

Commit b53a783

Browse files
committed
Fix bug in memory free
1 parent 4641db6 commit b53a783

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

cmdplaypp/src/ConsoleUtils.cpp

+1-18
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99

1010
void cmdplay::ConsoleUtils::SetCursorPosition(int x, int y)
1111
{
12-
#ifdef mac
13-
// The ANSI escape code to move the cursor is "\033[y;xH"
14-
// So we can print this string with x and y replaced by the function's parameters
1512
std::cout << "\033[" << y << ";" << x << "H";
16-
#else
17-
COORD pos = { static_cast<short>(x), static_cast<short>(y) };
18-
HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);
19-
SetConsoleCursorPosition(output, pos);
20-
#endif
2113
}
2214

2315
void cmdplay::ConsoleUtils::GetWindowSize(int* width, int* height)
@@ -57,13 +49,4 @@ void cmdplay::ConsoleUtils::ShowConsoleCursor(bool show)
5749
cursorInfo.bVisible = show;
5850
SetConsoleCursorInfo(out, &cursorInfo);
5951
#endif
60-
}
61-
62-
bool cmdplay::ConsoleUtils::GetWindowFocused()
63-
{
64-
#ifdef mac
65-
return true;
66-
#else
67-
return GetConsoleWindow() == GetForegroundWindow();
68-
#endif
69-
}
52+
}

cmdplaypp/src/ConsoleUtils.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ namespace cmdplay
77
static void SetCursorPosition(int x, int y);
88
static void GetWindowSize(int* width, int* height);
99
static void ShowConsoleCursor(bool show);
10-
static bool GetWindowFocused();
1110
};
1211
}

cmdplaypp/src/video/DecodedFrame.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <stdint.h>
3+
34
namespace cmdplay
45
{
56
namespace video
@@ -28,7 +29,7 @@ namespace cmdplay
2829

2930
~DecodedFrame()
3031
{
31-
delete m_data;
32+
delete[] m_data;
3233
}
3334
};
3435
}

0 commit comments

Comments
 (0)