From 4175d475a610d2ed581116a960a77df4efe6890d Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 30 May 2015 19:52:45 +0000 Subject: Dropbox: - fixed contact creation after auth - more correct way to release response object - version bumb git-svn-id: http://svn.miranda-ng.org/main/trunk@13910 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/http_request.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'plugins/Dropbox/src/http_request.h') diff --git a/plugins/Dropbox/src/http_request.h b/plugins/Dropbox/src/http_request.h index 9980945b66..dc0c006b47 100644 --- a/plugins/Dropbox/src/http_request.h +++ b/plugins/Dropbox/src/http_request.h @@ -31,7 +31,7 @@ public: } }; -class HttpRequest : protected NETLIBHTTPREQUEST//, public MZeroedObject +class HttpRequest : protected NETLIBHTTPREQUEST { private: CMStringA m_szUrl; @@ -163,4 +163,26 @@ public: } }; +class NetlibPtr +{ +protected: + NETLIBHTTPREQUEST *_p; + +public: + __inline explicit NetlibPtr(NETLIBHTTPREQUEST *p) : _p(p) {} + __inline NETLIBHTTPREQUEST* operator=(NETLIBHTTPREQUEST *p) + { + if (p) + CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)(NETLIBHTTPREQUEST*)p); + _p = p; + return _p; + } + __inline operator NETLIBHTTPREQUEST*() const { return _p; } + __inline NETLIBHTTPREQUEST* operator->() const { return _p; } + __inline ~NetlibPtr() + { + CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)(NETLIBHTTPREQUEST*)this); + } +}; + #endif //_HTTP_REQUEST_H_ \ No newline at end of file -- cgit v1.2.3