зеркало из https://github.com/mozilla/pjs.git
Initialize managers asap in child actors
This commit is contained in:
Родитель
421372d8d7
Коммит
2dc4373d72
|
@ -1614,6 +1614,19 @@ class GenerateProtocolActorHeader(Visitor):
|
|||
cxx.ExprCall(cxx.ExprVar('Register'),
|
||||
[ objvar ]))))
|
||||
|
||||
impl.addstmt(cxx.StmtExpr(cxx.ExprAssn(
|
||||
cxx.ExprSelect(objvar, '->', 'mManager'),
|
||||
cxx.ExprVar('this'))))
|
||||
if self.p.decl.type.isManaged():
|
||||
channelvar = cxx.ExprVar('mChannel')
|
||||
else:
|
||||
channelvar = cxx.ExprAddrOf(cxx.ExprVar('mChannel'))
|
||||
impl.addstmt(cxx.StmtExpr(cxx.ExprAssn(
|
||||
cxx.ExprSelect(objvar, '->', 'mChannel'),
|
||||
channelvar)))
|
||||
|
||||
impl.addstmt(cxx.Whitespace.NL)
|
||||
|
||||
impl.addstmt(cxx.StmtDecl(
|
||||
cxx.Decl(cxx.Type('mozilla::ipc::ActorHandle'),
|
||||
'__ah')))
|
||||
|
@ -1930,18 +1943,6 @@ class GenerateProtocolActorHeader(Visitor):
|
|||
static=1),
|
||||
'got reply ')
|
||||
|
||||
if md.decl.type.isCtor():
|
||||
impl.addstmt(cxx.StmtExpr(cxx.ExprAssn(
|
||||
cxx.ExprSelect(objvar, '->', 'mManager'),
|
||||
cxx.ExprVar('this'))))
|
||||
if self.p.decl.type.isManaged():
|
||||
channelvar = cxx.ExprVar('mChannel')
|
||||
else:
|
||||
channelvar = cxx.ExprAddrOf(cxx.ExprVar('mChannel'))
|
||||
impl.addstmt(cxx.StmtExpr(cxx.ExprAssn(
|
||||
cxx.ExprSelect(objvar, '->', 'mChannel'),
|
||||
channelvar)))
|
||||
|
||||
elif md.decl.type.isDtor():
|
||||
impl.addstmt(cxx.StmtExpr(
|
||||
cxx.ExprCall(cxx.ExprVar('Unregister'), [ objid ])))
|
||||
|
|
Загрузка…
Ссылка в новой задаче