src/helper/yans-wifi-helper.cc
changeset 6313 351d1431d58d
parent 6299 56ac87d0f2f9
child 6459 d5cfe99001f0
--- a/src/helper/yans-wifi-helper.cc	Thu May 20 13:45:20 2010 -0700
+++ b/src/helper/yans-wifi-helper.cc	Thu May 20 17:06:38 2010 -0700
@@ -471,6 +471,7 @@
           filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device);
         }
 
+      Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream (filename);
       //
       // We could go poking through the phy and the state looking for the 
       // correct trace source, but we can let Config deal with that with 
@@ -479,11 +480,11 @@
       //
       oss.str ("");
       oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/RxOk";
-      Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&AsciiPhyReceiveSinkWithoutContext, stream));
+      Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&AsciiPhyReceiveSinkWithoutContext, theStream));
 
       oss.str ("");
       oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/Tx";
-      Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&AsciiPhyTransmitSinkWithoutContext, stream));
+      Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&AsciiPhyTransmitSinkWithoutContext, theStream));
 
       return;
     }