diff options
author | Albert Astals Cid <aacid@kde.org> | 2017-05-12 23:03:28 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2017-05-12 23:03:28 +0200 |
commit | b1f4e35fa2da8909dee07529ce1dd9445639793b (patch) | |
tree | 5a11b81f99df67e612eda6b21a105053d33c315b /glib/poppler-attachment.cc | |
parent | d34e5304a9094d505ffce8ec4069d4ddf2ee5950 (diff) |
Make Stream incRef/decRef private
Object handles it for us
Also remove incRef/decRef from OutStream
Diffstat (limited to 'glib/poppler-attachment.cc')
-rw-r--r-- | glib/poppler-attachment.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/glib/poppler-attachment.cc b/glib/poppler-attachment.cc index 55936e78..5d84595a 100644 --- a/glib/poppler-attachment.cc +++ b/glib/poppler-attachment.cc @@ -35,7 +35,7 @@ typedef struct _PopplerAttachmentPrivate PopplerAttachmentPrivate; struct _PopplerAttachmentPrivate { - Object *obj_stream; + Object obj_stream; }; #define POPPLER_ATTACHMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), POPPLER_TYPE_ATTACHMENT, PopplerAttachmentPrivate)) @@ -64,12 +64,7 @@ poppler_attachment_dispose (GObject *obj) PopplerAttachmentPrivate *priv; priv = POPPLER_ATTACHMENT_GET_PRIVATE (obj); - - if (priv->obj_stream) - { - delete priv->obj_stream; - priv->obj_stream = NULL; - } + priv->obj_stream = Object(); G_OBJECT_CLASS (poppler_attachment_parent_class)->dispose (obj); } @@ -126,9 +121,7 @@ _poppler_attachment_new (FileSpec *emb_file) if (embFile->checksum () && embFile->checksum ()->getLength () > 0) attachment->checksum = g_string_new_len (embFile->checksum ()->getCString (), embFile->checksum ()->getLength ()); - priv->obj_stream = new Object(embFile->stream()); - // Copy the stream - embFile->stream()->incRef(); + priv->obj_stream = embFile->streamObject()->copy(); return attachment; } @@ -241,7 +234,7 @@ poppler_attachment_save_to_callback (PopplerAttachment *attachment, g_return_val_if_fail (POPPLER_IS_ATTACHMENT (attachment), FALSE); - stream = POPPLER_ATTACHMENT_GET_PRIVATE (attachment)->obj_stream->getStream(); + stream = POPPLER_ATTACHMENT_GET_PRIVATE (attachment)->obj_stream.getStream(); stream->reset(); do |