Use HashMap::remove() in some places that I wanted it.
This commit is contained in:
parent
969334505d
commit
6ea8ce500c
Notes:
sideshowbarker
2024-07-19 18:49:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6ea8ce500c5
5 changed files with 10 additions and 5 deletions
|
@ -18,8 +18,7 @@ FileSystem::FileSystem()
|
|||
|
||||
FileSystem::~FileSystem()
|
||||
{
|
||||
// FIXME: Needs HashMap::remove()!
|
||||
//fileSystems().remove(m_id);
|
||||
fileSystems().remove(m_id);
|
||||
}
|
||||
|
||||
FileSystem* FileSystem::fromID(dword id)
|
||||
|
|
|
@ -115,11 +115,10 @@ void VirtualFileSystem::freeNode(Node* node)
|
|||
{
|
||||
ASSERT(node);
|
||||
ASSERT(node->inUse());
|
||||
m_inode2vnode.remove(node->inode);
|
||||
node->inode.fileSystem()->release();
|
||||
node->inode = InodeIdentifier();
|
||||
m_nodeFreeList.append(std::move(node));
|
||||
// FIXME: Need HashMap::remove.
|
||||
//m_inode2vnode.remove(node);
|
||||
}
|
||||
|
||||
bool VirtualFileSystem::isDirectory(const String& path)
|
||||
|
|
|
@ -11,6 +11,7 @@ Window::Window(Object* parent)
|
|||
|
||||
Window::~Window()
|
||||
{
|
||||
WindowManager::the().removeWindow(*this);
|
||||
}
|
||||
|
||||
void Window::setMainWidget(Widget* widget)
|
||||
|
@ -31,7 +32,6 @@ void Window::setTitle(String&& title)
|
|||
WindowManager::the().notifyTitleChanged(*this);
|
||||
}
|
||||
|
||||
|
||||
void Window::setRect(const Rect& rect)
|
||||
{
|
||||
if (m_rect == rect)
|
||||
|
|
|
@ -118,6 +118,12 @@ void WindowManager::addWindow(Window& window)
|
|||
m_windows.set(&window);
|
||||
}
|
||||
|
||||
void WindowManager::removeWindow(Window& window)
|
||||
{
|
||||
ASSERT(m_windows.contains(&window));
|
||||
m_windows.remove(&window);
|
||||
}
|
||||
|
||||
void WindowManager::notifyTitleChanged(Window& window)
|
||||
{
|
||||
//printf("[WM] Window{%p} title set to '%s'\n", &window, window.title().characters());
|
||||
|
|
|
@ -14,6 +14,7 @@ class WindowManager : public Object {
|
|||
public:
|
||||
static WindowManager& the();
|
||||
void addWindow(Window&);
|
||||
void removeWindow(Window&);
|
||||
void paintWindowFrames();
|
||||
|
||||
void notifyTitleChanged(Window&);
|
||||
|
|
Loading…
Add table
Reference in a new issue