Open GoogleCodeExporter opened 9 years ago
[deleted comment]
Note that the same happens if Global and ProxyObj inherit from PyV8.JSClass vs.
from object.
The same also happens without having the function `foo` involved. That is:
var theObj = Obj();
theObj.what();
theObj.what();
theObj.what();
theObj;
Original comment by csaft...@gmail.com
on 17 Jul 2013 at 4:42
[deleted comment]
* If ProxyObj inherits from JSObject, same behavior.
* The function doesn't have to be called. If this is Case 2 , you get the same
output:
var theObj = Obj();
theObj.what;
theObj.what;
theObj.what;
theObj;
* If 'what' is a variable or a function/not an instance method, bug doesn't
happen, i.e.:
class ProxyObj(object):
def __init__(self):
self.what = None
or
def f():
pass
class ProxyObj(object):
def __init__(self):
self.what = f
* It also doesn't happen if I make a 'fake' instance method:
def f(self):
pass
class ProxyObj(object):
def __init__(self):
self.what = lambda: f(self)
In this case the reference counts are both '4'.
* No bug if it's a static method or classmethod:
class ProxyObj(object):
def __init__(self):
pass
@staticmethod
def what():
pass
or
class ProxyObj(object):
def __init__(self):
pass
@classmethod
def what():
pass
In both cases, both cases are '3'.
* Basically seems to be an instancemethod issue.
Original comment by csaft...@gmail.com
on 17 Jul 2013 at 4:52
* @property is also not a problem, that is:
class ProxyObj(object):
def __init__(self):
pass
@property
def what(self):
return 100
Doesn't cause the leak
Original comment by csaft...@gmail.com
on 17 Jul 2013 at 5:48
Original issue reported on code.google.com by
csaft...@gmail.com
on 17 Jul 2013 at 4:40Attachments: