mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
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:
parent
7df0e2a9aa
commit
43b6c6378e
@ -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() {}
|
||||
|
Loading…
Reference in New Issue
Block a user