summaryrefslogtreecommitdiffstats
path: root/common/entitybuffer.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-17 20:24:51 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-17 20:24:51 +0200
commitc81fe1578e4151e230ffa08a6c5b26b535593ee7 (patch)
treeb301309f15b9f70f52b05a13af756352bced84cb /common/entitybuffer.h
parenteb54f3795fb276046c1a4c0e81fb5426f0659550 (diff)
downloadsink-c81fe1578e4151e230ffa08a6c5b26b535593ee7.tar.gz
sink-c81fe1578e4151e230ffa08a6c5b26b535593ee7.zip
Copy the entity when we return it.
Otherwise we easily end up copying it and then have an entity that points into nowhere. Callback -> no copy, no callback -> copy.
Diffstat (limited to 'common/entitybuffer.h')
-rw-r--r--common/entitybuffer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/entitybuffer.h b/common/entitybuffer.h
index 4162605..d73a138 100644
--- a/common/entitybuffer.h
+++ b/common/entitybuffer.h
@@ -12,7 +12,18 @@ struct Entity;
12class SINK_EXPORT EntityBuffer 12class SINK_EXPORT EntityBuffer
13{ 13{
14public: 14public:
15 /**
16 * Creates an entity buffer from @param dataValue.
17 *
18 * Note that @param dataValue will need to remain valid and the data is not copied.
19 */
15 EntityBuffer(const void *dataValue, int size); 20 EntityBuffer(const void *dataValue, int size);
21
22 /**
23 * Creates an entity buffer from @param data.
24 *
25 * Note that @param data will need to remain valid and the data is not copied.
26 */
16 EntityBuffer(const QByteArray &data); 27 EntityBuffer(const QByteArray &data);
17 const uint8_t *resourceBuffer(); 28 const uint8_t *resourceBuffer();
18 const uint8_t *metadataBuffer(); 29 const uint8_t *metadataBuffer();