Protocol should hang onto shared pointer for protection but always use underlying raw pointer

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664982 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Slee 2007-02-07 00:54:17 +00:00
parent 7df0e2a9aa
commit 43b6c6378e

View File

@ -283,23 +283,26 @@ class TProtocol {
}
inline shared_ptr<TTransport> getTransport() {
return trans_;
return ptrans_;
}
// TODO: remove these two calls, they are for backwards
// compatibility
inline shared_ptr<TTransport> getInputTransport() {
return trans_;
return ptrans_;
}
inline shared_ptr<TTransport> getOutputTransport() {
return trans_;
return ptrans_;
}
protected:
TProtocol(shared_ptr<TTransport> trans):
trans_(trans) {}
TProtocol(shared_ptr<TTransport> ptrans):
ptrans_(ptrans) {
trans_ = ptrans.get();
}
shared_ptr<TTransport> trans_;
shared_ptr<TTransport> ptrans_;
TTransport* trans_;
private:
TProtocol() {}