mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Free movingBar memory on exit
This commit is contained in:
parent
8a849bc85a
commit
71c068ad28
@ -27,6 +27,13 @@ static const char* const MetersMovingKeys[] = {"Space", "Enter", "Up", "Dn", "<-
|
||||
static int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)};
|
||||
static FunctionBar* Meters_movingBar = NULL;
|
||||
|
||||
void MetersPanel_cleanup() {
|
||||
if (Meters_movingBar) {
|
||||
FunctionBar_delete(Meters_movingBar);
|
||||
Meters_movingBar = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void MetersPanel_delete(Object* object) {
|
||||
Panel* super = (Panel*) object;
|
||||
MetersPanel* this = (MetersPanel*) object;
|
||||
|
@ -24,6 +24,8 @@ struct MetersPanel_ {
|
||||
bool moving;
|
||||
};
|
||||
|
||||
void MetersPanel_cleanup(void);
|
||||
|
||||
void MetersPanel_setMoving(MetersPanel* this, bool moving);
|
||||
|
||||
extern PanelClass MetersPanel_class;
|
||||
|
2
htop.c
2
htop.c
@ -12,6 +12,7 @@ in the source distribution for its full text.
|
||||
#include "ColumnsPanel.h"
|
||||
#include "CRT.h"
|
||||
#include "MainPanel.h"
|
||||
#include "MetersPanel.h"
|
||||
#include "ProcessList.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "Settings.h"
|
||||
@ -277,6 +278,7 @@ int main(int argc, char** argv) {
|
||||
ProcessList_delete(pl);
|
||||
|
||||
ScreenManager_delete(scr);
|
||||
MetersPanel_cleanup();
|
||||
|
||||
UsersTable_delete(ut);
|
||||
Settings_delete(settings);
|
||||
|
Loading…
Reference in New Issue
Block a user