Fixed a couple memory leaks where adapters were not being properly deleted.

This commit is contained in:
casey 2016-09-11 11:33:00 -07:00
parent db4b97711c
commit 2379b94473
3 changed files with 10 additions and 12 deletions

View File

@ -53,7 +53,8 @@ OutputWindow::OutputWindow(IWindow *parent)
}
OutputWindow::~OutputWindow() {
delete this->adapter;
this->adapter = nullptr;
}
IScrollAdapter& OutputWindow::GetScrollAdapter() {

View File

@ -62,7 +62,7 @@ TrackListView::TrackListView(
PlaybackService& playback,
LibraryPtr library,
RowFormatter formatter)
: ListWindow(NULL)
: ListWindow(nullptr)
, playback(playback) {
this->library = library;
this->library->QueryCompleted.connect(this, &TrackListView::OnQueryCompleted);
@ -79,7 +79,8 @@ TrackListView::TrackListView(
}
TrackListView::~TrackListView() {
delete this->adapter;
this->adapter = nullptr;
}
void TrackListView::Requery(std::shared_ptr<TrackListQueryBase> query) {
@ -199,11 +200,6 @@ static std::string formatWithoutAlbum(TrackPtr track, size_t width) {
text::AlignLeft,
titleWidth);
if (title.find("Ragat") != std::string::npos) {
int n = 10;
n++;
}
return boost::str(
boost::format("%s %s %s %s")
% trackNum % title % duration % artist);

View File

@ -83,6 +83,7 @@ namespace musik {
class Adapter : public cursespp::ScrollAdapterBase {
public:
Adapter(TrackListView &parent);
virtual ~Adapter() { }
virtual size_t GetEntryCount();
virtual EntryPtr GetEntry(size_t index);