зеркало из https://github.com/mozilla/pjs.git
Fix for bug #313408: Need to update HG10297 and HG81272 macros in rosetta.h
and fix for Memory leak introduced in yesterdays checkin. Files checked in: Command.cpp, Command.h and EditorView.cpp
This commit is contained in:
Родитель
4c8b1ffe5f
Коммит
0d8f5d762b
|
@ -439,6 +439,16 @@ XFE_CommandList::XFE_CommandList(XFE_CommandList* list, XFE_Command* command)
|
|||
m_command = command;
|
||||
}
|
||||
|
||||
XFE_CommandList::~XFE_CommandList()
|
||||
{
|
||||
m_next = 0;
|
||||
|
||||
if (m_command) {
|
||||
delete m_command;
|
||||
m_command = 0;
|
||||
}
|
||||
}
|
||||
|
||||
XFE_CommandList*
|
||||
registerCommand(XFE_CommandList*& list, XFE_Command* command)
|
||||
{
|
||||
|
@ -457,6 +467,18 @@ findCommand(XFE_CommandList* list, CommandType id)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
destroyCommandList(XFE_CommandList* list)
|
||||
{
|
||||
XFE_CommandList *next;
|
||||
|
||||
while (list != NULL) {
|
||||
next = list->m_next;
|
||||
delete list;
|
||||
list = next;
|
||||
}
|
||||
}
|
||||
|
||||
XFE_ObjectIsCommand::XFE_ObjectIsCommand(XFE_View *view) : XFE_ViewCommand(xfeCmdObjectIs, view)
|
||||
{
|
||||
};
|
||||
|
|
|
@ -222,8 +222,10 @@ class XFE_CommandList {
|
|||
public:
|
||||
friend XFE_Command* findCommand(XFE_CommandList*, CommandType);
|
||||
friend XFE_CommandList* registerCommand(XFE_CommandList*&, XFE_Command*);
|
||||
friend void destroyCommandList(XFE_CommandList*);
|
||||
private:
|
||||
XFE_CommandList(XFE_CommandList*, XFE_Command*);
|
||||
~XFE_CommandList();
|
||||
XFE_CommandList* m_next;
|
||||
XFE_Command* m_command;
|
||||
};
|
||||
|
|
|
@ -36,10 +36,6 @@
|
|||
#include "pk11func.h"
|
||||
#endif
|
||||
|
||||
/* BIG HACK HERE. REMOVE MUCH SOON. needs to be fixed in
|
||||
ns/modules/security/nav/rosetta.h*/
|
||||
#define my_commands m_commands
|
||||
|
||||
extern "C" int XFE_EDITOR_NEWTABLE_COLS;
|
||||
|
||||
#define FE_SYNTAX_ERROR() doSyntaxErrorAlert(view, info)
|
||||
|
@ -3058,6 +3054,10 @@ XFE_EditorView::~XFE_EditorView()
|
|||
XtRemoveTimeOut(m_update_timer);
|
||||
m_update_timer = 0;
|
||||
}
|
||||
if (m_commands) {
|
||||
destroyCommandList(m_commands);
|
||||
m_commands = 0;
|
||||
}
|
||||
}
|
||||
|
||||
char*
|
||||
|
|
Загрузка…
Ссылка в новой задаче