summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang')
-rwxr-xr-xsource/slang/slang-compiler.h8
-rw-r--r--source/slang/slang.cpp10
2 files changed, 11 insertions, 7 deletions
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h
index e7114fc2c..5ba121742 100755
--- a/source/slang/slang-compiler.h
+++ b/source/slang/slang-compiler.h
@@ -2656,6 +2656,8 @@ namespace Slang
EndToEndCompileRequest(
Linkage* linkage);
+ ~EndToEndCompileRequest();
+
// What container format are we being asked to generate?
// If it's set to a format, the container blob will be calculated during compile
ContainerFormat m_containerFormat = ContainerFormat::None;
@@ -2761,11 +2763,7 @@ namespace Slang
{
return m_specializedEntryPoints[index];
}
- ~EndToEndCompileRequest()
- {
- m_linkage = nullptr;
- m_frontEndReq = nullptr;
- }
+
void generateOutput();
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 13ef0cd81..f2e6c5497 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -1440,8 +1440,14 @@ void TranslationUnitRequest::addSourceFile(SourceFile* sourceFile)
}
}
+EndToEndCompileRequest::~EndToEndCompileRequest()
+{
+ // Flush any writers associated with the request
+ m_writers->flushWriters();
-//
+ m_linkage.setNull();
+ m_frontEndReq.setNull();
+}
static ISlangWriter* _getDefaultWriter(WriterChannel chan)
{
@@ -1467,7 +1473,7 @@ void EndToEndCompileRequest::setWriter(WriterChannel chan, ISlangWriter* writer)
// If the user passed in null, we will use the default writer on that channel
m_writers->setWriter(SlangWriterChannel(chan), writer ? writer : _getDefaultWriter(chan));
- // For diagnostic output, if the user passes in nullptr, we set on mSink.writer as that enables buffering on DiagnosticSink
+ // For diagnostic output, if the user passes in nullptr, we set on m_sink.writer as that enables buffering on DiagnosticSink
if (chan == WriterChannel::Diagnostic)
{
m_sink.writer = writer;