licq-im / licq

An instant messaging client for UNIX
http://www.licq.org/
16 stars 4 forks source link

licq: pass signals and events as shared_ptr's #26

Closed erijo closed 11 years ago

erijo commented 11 years ago

Avoids memory leak in case plugin isn't ready to handle signal or it it has been shutdown

flynd commented 11 years ago

I think this is a good idea, but if I'm reading it right each plugin still gets a separate copy of the signal. Wouldn't the main advantage of using a shared pointer that we could skip the copy and give all of them the same pointer? I don't think any of the plugins actually modify the signals they get so it should just be a matter of adding a few const declarations.

erijo commented 11 years ago

Good idea. I'll try to const-ify it.

flynd commented 11 years ago

I see you consted all of them. It would have been enough to only const the plugin signals as events and protocol signals are always sent to just a single plugin/protocol (with the exception of the ProtocolGroupSignal which is sent several times by the UserManager). However, now that it's done, I see no reason to undo the const declarations for the protocol signals.