aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/glk/glulxe/glkop.cpp1
-rw-r--r--engines/glk/streams.cpp5
-rw-r--r--engines/glk/streams.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/engines/glk/glulxe/glkop.cpp b/engines/glk/glulxe/glkop.cpp
index 635d90bb7b..70fb44b85e 100644
--- a/engines/glk/glulxe/glkop.cpp
+++ b/engines/glk/glulxe/glkop.cpp
@@ -677,6 +677,7 @@ void Glulxe::unparse_glk_args(dispatch_splot_t *splot, const char **proto, int d
opref = garglist[gargnum]._opaqueref;
if (opref) {
gidispatch_rock_t objrock = gidispatch_get_objrock(opref, *cx - 'a');
+ assert(objrock.ptr);
thisval = ((classref_t *)objrock.ptr)->id;
} else {
thisval = 0;
diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp
index 907cde4d66..e0271baea8 100644
--- a/engines/glk/streams.cpp
+++ b/engines/glk/streams.cpp
@@ -1588,6 +1588,11 @@ frefid_t Streams::iterate(frefid_t fref, uint *rock) {
/*--------------------------------------------------------------------------*/
+FileReference::FileReference() : _rock(0), _slotNumber(-1), _fileType(fileusage_Data), _textMode(false) {
+ if (g_vm->gli_register_obj)
+ _dispRock = (*g_vm->gli_register_obj)(this, gidisp_Class_Fileref);
+}
+
FileReference::FileReference(int slot, const Common::String &desc, uint usage, uint rock) :
_rock(rock), _slotNumber(slot), _description(desc),
_fileType((FileUsage)(usage & fileusage_TypeMask)), _textMode(usage & fileusage_TextMode) {
diff --git a/engines/glk/streams.h b/engines/glk/streams.h
index f899936ef3..14ca91dfc0 100644
--- a/engines/glk/streams.h
+++ b/engines/glk/streams.h
@@ -98,7 +98,7 @@ struct FileReference {
/**
* Constructor
*/
- FileReference() : _rock(0), _slotNumber(-1), _fileType(fileusage_Data), _textMode(false) {}
+ FileReference();
/**
* Constructor