Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Fix #29 - Reset the FileManager when MainScreen is closed
Browse files Browse the repository at this point in the history
This fixes the issue where the FileManager wouldn't be reset, when the
user switched back to the SelectionScreen.
  • Loading branch information
rm-code committed Apr 17, 2015
1 parent f3ee59f commit e3899ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FileManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ function FileManager.remove(fileName)
createSortedList(extensions);
end

function FileManager.reset()
extensions = {};
sortedList = {};
totalFiles = 0;
colors = nil;
end

-- ------------------------------------------------
-- Getters
-- ------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions src/screens/MainScreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ function MainScreen.new()
camera:move(dt);
end

function self:close()
FileManager.reset();
end

function self:quit()
if ConfigReader.getConfig('options').removeTmpFiles then
ConfigReader.removeTmpFiles();
Expand Down

0 comments on commit e3899ea

Please sign in to comment.