From 3e8d588e9b7c10d148c9c4a1996017cbeec8e4d9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 29 Apr 2013 09:53:29 +0200 Subject: [PATCH] ipa: Make the handler a variable on the class side * Making it a classVariable will make subclasses manipulate the base variable. By making it a variable on the class side avoids this issue. --- ipa/IPAProtoHandler.st | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ipa/IPAProtoHandler.st b/ipa/IPAProtoHandler.st index d841611..b6060cd 100644 --- a/ipa/IPAProtoHandler.st +++ b/ipa/IPAProtoHandler.st @@ -24,7 +24,9 @@ Object subclass: IPAProtoHandler [ behavior.'> - handlers := nil. + IPAProtoHandler class [ + | handlers | + ] IPAProtoHandler class >> initialize [ @@ -35,6 +37,10 @@ Object subclass: IPAProtoHandler [ at: IPAConstants msgIdAck put: #handleIdAck:. ] + IPAProtoHandler class >> handlers [ + ^ handlers + ] + registerOn: aDispatcher [ aDispatcher addHandler: IPAConstants protocolIPA on: self with: #handleMsg:. @@ -54,7 +60,7 @@ Object subclass: IPAProtoHandler [ | selector | - selector := handlers at: (aMsg first asInteger) ifAbsent: [ + selector := self class handlers at: (aMsg first asInteger) ifAbsent: [ self logError: 'IPA message not understood', aMsg first asInteger asString area: #ipa. ^ false