mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-21 21:40:48 +00:00
Fixed a couple memory leaks where adapters were not being properly deleted.
This commit is contained in:
parent
db4b97711c
commit
2379b94473
@ -53,7 +53,8 @@ OutputWindow::OutputWindow(IWindow *parent)
|
||||
}
|
||||
|
||||
OutputWindow::~OutputWindow() {
|
||||
|
||||
delete this->adapter;
|
||||
this->adapter = nullptr;
|
||||
}
|
||||
|
||||
IScrollAdapter& OutputWindow::GetScrollAdapter() {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user