<style type='text/css'>.TerraceMsg { font-size: 12px; font-family:Dotum, Arial, Verdana, Sans-Serif;}.Bold { font-weight: bold; }</style><div class='TerraceMsg'><p>contents is title</p><p> </p><p>Segmentation fault has occured when I try to delete medium in void MediaLookupTable::remove(char const* name)</p><p> </p><p>here is my code</p><p> </p><div style="background-color: rgb(30, 30, 30); line-height: 19px;"><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"><span style="color: #569cd6;">void</span> <span style="color: #4ec9b0;">MediaLookupTable</span>::<span style="color: #dcdcaa;">remove</span>(<span style="color: #569cd6;">char</span> <span style="color: #569cd6;">const</span>*<span style="color: #9cdcfe;"> name</span>) {</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #4ec9b0;">std</span>::cout << <span style="color: #ce9178;">"Called MediaLookupTable::remove"</span> << <span style="color: #4ec9b0;">std</span>::endl;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> Medium* medium = <span style="color: #dcdcaa;">lookup</span>(name);</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #c586c0;">if</span> (medium != <span style="color: #569cd6;">NULL</span>) {</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #9cdcfe;">fTable</span>-><span style="color: #dcdcaa;">Remove</span>(name);</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #c586c0;">if</span> (<span style="color: #9cdcfe;">fTable</span>-><span style="color: #dcdcaa;">IsEmpty</span>()) {</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #6a9955;">// We can also delete ourselves (to reclaim space):</span></div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> _Tables* ourTables = <span style="color: #4ec9b0;">_Tables</span>::<span style="color: #dcdcaa;">getOurTables</span>(fEnv);</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #c586c0;">delete</span> <span style="color: #569cd6;">this</span>;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #9cdcfe;">ourTables</span>-><span style="color: #9cdcfe;">mediaTable</span> = <span style="color: #569cd6;">NULL</span>;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #9cdcfe;">ourTables</span>-><span style="color: #dcdcaa;">reclaimIfPossible</span>();</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> }</div><br><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #4ec9b0;">std</span>::cout << <span style="color: #ce9178;">"Removing specific medium: "</span> << name << <span style="color: #4ec9b0;">std</span>::endl;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #c586c0;">delete</span> medium;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #4ec9b0;">std</span>::cout << <span style="color: #ce9178;">"Removed medium: "</span> << name << <span style="color: #4ec9b0;">std</span>::endl;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> }</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"> <span style="color: #4ec9b0;">std</span>::cout << <span style="color: #ce9178;">"End MediaLookupTable::remove"</span> << <span style="color: #4ec9b0;">std</span>::endl;</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">}</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"><br></div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">terminal output is</div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"><br></div><div style=""><font color="#d4d4d4" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="font-size: 14px; white-space: pre;">Closing GVRTSPClient ...
Called MediaLookupTable::remove
Removing specific medium: liveMedia0
./start.sh: line 7: 46728 Segmentation fault (core dumped)</span></font></div><div style=""><font color="#d4d4d4" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="font-size: 14px; white-space: pre;"><br></span></font></div><div style=""><font color="#d4d4d4" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="font-size: 14px; white-space: pre;">please let me know this..</span></font></div><div style="color: rgb(212, 212, 212); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;"><br></div></div></div><br><br>
<div id='TMSMDN' style="background:url('http://mail.kangwon.ac.kr:80/mail/receiveMDN.do?mdnData=3uu13n2anl6d3EtBNEhpnRGQtee0UFF6moVtrLSyzYsOYQYWdFnCG8%2BHMDyfuF4m2ShRpCKSereL%0ANE1NE%2FGN4PXbnk5ThvdSexbq2qLX07RTS5PGDI9WoaZe8aNQcY%2Fr783eXY%2B5tPnApW75qwucqGD2%0AGAGWkAc30RpDFxcUrN8knUbQp7lybLpD1Hnfyu4Z%0A')"></div>