Skip to content

Commit a899437

Browse files
committed
Remove keep stream, issue #108
1 parent 21ad9aa commit a899437

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

fitz_cgo.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ func NewFromMemory(b []byte) (f *Document, err error) {
135135

136136
C.fz_register_document_handlers(f.ctx)
137137

138-
stream := C.fz_open_memory(f.ctx, (*C.uchar)(&b[0]), C.size_t(len(b)))
139-
f.stream = C.fz_keep_stream(f.ctx, stream)
140-
138+
f.stream = C.fz_open_memory(f.ctx, (*C.uchar)(&b[0]), C.size_t(len(b)))
141139
if f.stream == nil {
142140
err = ErrOpenMemory
143141
return

fitz_nocgo.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ func NewFromMemory(b []byte) (f *Document, err error) {
7474

7575
fzRegisterDocumentHandlers(f.ctx)
7676

77-
stream := fzOpenMemory(f.ctx, unsafe.SliceData(b), uint64(len(b)))
78-
f.stream = fzKeepStream(f.ctx, stream)
79-
77+
f.stream = fzOpenMemory(f.ctx, unsafe.SliceData(b), uint64(len(b)))
8078
if f.stream == nil {
8179
err = ErrOpenMemory
8280
return
@@ -533,7 +531,6 @@ var (
533531
fzOpenDocument func(ctx *fzContext, filename string) *fzDocument
534532
fzOpenDocumentWithStream func(ctx *fzContext, magic string, stream *fzStream) *fzDocument
535533
fzOpenMemory func(ctx *fzContext, data *uint8, len uint64) *fzStream
536-
fzKeepStream func(ctx *fzContext, stm *fzStream) *fzStream
537534
fzDropStream func(ctx *fzContext, stm *fzStream)
538535
fzRegisterDocumentHandlers func(ctx *fzContext)
539536
fzNeedsPassword func(ctx *fzContext, doc *fzDocument) int
@@ -591,7 +588,6 @@ func init() {
591588
purego.RegisterLibFunc(&fzOpenDocument, libmupdf, "fz_open_document")
592589
purego.RegisterLibFunc(&fzOpenDocumentWithStream, libmupdf, "fz_open_document_with_stream")
593590
purego.RegisterLibFunc(&fzOpenMemory, libmupdf, "fz_open_memory")
594-
purego.RegisterLibFunc(&fzKeepStream, libmupdf, "fz_keep_stream")
595591
purego.RegisterLibFunc(&fzDropStream, libmupdf, "fz_drop_stream")
596592
purego.RegisterLibFunc(&fzRegisterDocumentHandlers, libmupdf, "fz_register_document_handlers")
597593
purego.RegisterLibFunc(&fzNeedsPassword, libmupdf, "fz_needs_password")

0 commit comments

Comments
 (0)