[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] FileIO extension eating up memory (was: Building extensi
From: |
strk |
Subject: |
Re: [Gnash-dev] FileIO extension eating up memory (was: Building extensions) |
Date: |
Wed, 9 May 2007 12:13:04 +0200 |
On Wed, May 09, 2007 at 12:05:27PM +0200, strk wrote:
> > I'm less euphoric now :/
> >
> > I see attachInterface() is called each time I open* a file and thus
> > Gnash is quickly eating up all my memory...
>
> I confirm the C++ code doesn't reflect the correct ActionScripti classes
> initialization. It's calling attachInterface on every *instance*.
> As long as you create multiple instances attachInterface() will be called
> again.
> I'm going to fix it now.
Try this patch:
Index: extensions/fileio/fileio.cpp
===================================================================
RCS file: /sources/gnash/gnash/extensions/fileio/fileio.cpp,v
retrieving revision 1.11
diff -U2 -r1.11 fileio.cpp
--- extensions/fileio/fileio.cpp 24 Apr 2007 17:52:47 -0000 1.11
+++ extensions/fileio/fileio.cpp 9 May 2007 10:11:45 -0000
@@ -115,5 +115,4 @@
Fileio * obj = new Fileio();
- attachInterface(obj);
return as_value(obj); // will keep alive
}
@@ -121,5 +120,7 @@
Fileio::Fileio()
- : _stream(0)
+ :
+ as_object(getInterface()),
+ _stream(0)
{
// GNASH_REPORT_FUNCTION;
@@ -521,5 +522,5 @@
// // replicate all interface to class, to be able to access
// // all methods as static functions
- attachInterface(cl.get());
+ //attachInterface(cl.get());
}
--strk;