title: std::map insert segmentation fault
body: <p>Why does this code stop with segmentation fault :</p>
  
  <pre><code>class MapFile
  {
   public:
     /* ... */
     std::map &lt;unsigned int, unsigned int&gt; inToOut;
  };
  
  bool MapFile::LoadMapFile( const wxString&amp; fileName )
  {
      /* ... */
     inToOut.insert( std::make_pair(input,output) );
  }
  </code></pre>
  
  <p>but when I put the "std::map  inToOut;" just before "inToOut.insert" it works just fine :</p>
  
  <pre><code>class MapFile
  {
   public:
     /* ... */
  };
  
  bool MapFile::LoadMapFile( const wxString&amp; fileName )
  {
      /* ... */
     std::map &lt;unsigned int, unsigned int&gt; inToOut;
     inToOut.insert( std::make_pair(input,output) );
  }
  </code></pre>
  
  <p>?</p>
  
  <hr>
  
  <p>OK. Thanks guys, it seems that I have fixed this issue thanks to your help.</p>
  
  <p>The problem was in the part of the code where I've been calling the LoadMapFile :</p>
  
  <pre><code>void WizardProductPage::OnTestButtonMapFile( wxCommandEvent&amp; event )
  {
     wxString filename;
     filename = locMapFile-&gt;GetValue();
  
     MapFile::LoadMapFile( filename );
  }
  </code></pre>
  
  <p>Should be :</p>
  
  <pre><code>void WizardProductPage::OnTestButtonMapFile( wxCommandEvent&amp; event )
  {
     wxString filename;
     filename = locMapFile-&gt;GetValue();
  
     MapFile mapFile;
     mapFile.LoadMapFile( filename );
  }
  </code></pre>