本文整理汇总了C++中SourceFile::hasOneRef方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceFile::hasOneRef方法的具体用法?C++ SourceFile::hasOneRef怎么用?C++ SourceFile::hasOneRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceFile
的用法示例。
在下文中一共展示了SourceFile::hasOneRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sourceUnused
bool KJSDebugWin::sourceUnused(KJS::ExecState *exec, int sourceId)
{
// Verify that there aren't any contexts on the stack using the given sourceId
// This should never be the case because this function is only called when
// the interpreter has deleted all Node objects for the source.
for(int e = 0; e < m_execsCount; e++)
assert(m_execs[e]->context().sourceId() != sourceId);
// Now remove the fragment (and the SourceFile, if it was the last fragment in that file)
SourceFragment *fragment = m_sourceFragments[sourceId];
if(fragment)
{
m_sourceFragments.erase(sourceId);
SourceFile *sourceFile = fragment->sourceFile;
if(sourceFile->hasOneRef())
{
for(int i = 0; i < m_sourceSel->count(); i++)
{
if(m_sourceSelFiles.at(i) == sourceFile)
{
m_sourceSel->removeItem(i);
m_sourceSelFiles.remove(i);
break;
}
}
removeSourceFile(exec->interpreter(), sourceFile->url);
}
delete fragment;
}
return (m_mode != Stop);
}