This looks pretty good. Remember that these variables are declared within the function saveOutput(), so they will be destroyed when the function exits. outStream is a unique_ptr, so it will be destroyed too.
You only need to worry about destroying things manually in C++ if you made them with
new (which you probably should avoid) or you used something particularly wonky.
note that the mentions of nullptr checks in those comments are referring to different objects.
outStream needs to be checked like this:
if (! outStream) return;
which exits the method if the stream couldn’t be created. Instead of
return you could put something more helpful like writing a debug message or something more specific.
Second, you need to check that the writer was made correctly, which looks like
if (! writer) return; for the same reason.