diff options
Diffstat (limited to 'media/mtp/MtpServer.h')
-rw-r--r-- | media/mtp/MtpServer.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/media/mtp/MtpServer.h b/media/mtp/MtpServer.h index 35a38e7..b06eb28 100644 --- a/media/mtp/MtpServer.h +++ b/media/mtp/MtpServer.h @@ -67,12 +67,22 @@ private: // represents an MTP object that is being edited using the android extensions // for direct editing (BeginEditObject, SendPartialObject, TruncateObject and EndEditObject) - struct ObjectEdit { - MtpObjectHandle handle; - MtpString path; - uint64_t size; - MtpObjectFormat format; - int fd; + class ObjectEdit { + public: + MtpObjectHandle mHandle; + MtpString mPath; + uint64_t mSize; + MtpObjectFormat mFormat; + int mFD; + + ObjectEdit(MtpObjectHandle handle, const char* path, uint64_t size, + MtpObjectFormat format, int fd) + : mHandle(handle), mPath(path), mSize(size), mFormat(format), mFD(fd) { + } + + virtual ~ObjectEdit() { + close(mFD); + } }; Vector<ObjectEdit*> mObjectEditList; |