mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
[qwaq] Use full file path for file search
Fixes the memory leak (over 300 editors...)
This commit is contained in:
parent
225ee0ed3c
commit
1914fa2756
1 changed files with 2 additions and 2 deletions
|
@ -53,6 +53,7 @@
|
||||||
-(Editor *) find_file:(string) filename
|
-(Editor *) find_file:(string) filename
|
||||||
{
|
{
|
||||||
Editor *file;
|
Editor *file;
|
||||||
|
filename = qdb_get_file_path (target, filename);
|
||||||
for (int i = [files count]; i-- > 0; ) {
|
for (int i = [files count]; i-- > 0; ) {
|
||||||
file = [files objectAtIndex: i];
|
file = [files objectAtIndex: i];
|
||||||
if ([file filename] == filename) {
|
if ([file filename] == filename) {
|
||||||
|
@ -62,8 +63,7 @@
|
||||||
Rect rect = {{1, 1}, [source_window size]};
|
Rect rect = {{1, 1}, [source_window size]};
|
||||||
rect.extent.width -= 2;
|
rect.extent.width -= 2;
|
||||||
rect.extent.height -= 2;
|
rect.extent.height -= 2;
|
||||||
string filepath = qdb_get_file_path (target, filename);
|
file = [Editor withRect:rect file:filename];
|
||||||
file = [Editor withRect:rect file:filepath];
|
|
||||||
[files addObject: file];
|
[files addObject: file];
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue