本文整理汇总了C++中BObjectList::RemoveItem方法的典型用法代码示例。如果您正苦于以下问题:C++ BObjectList::RemoveItem方法的具体用法?C++ BObjectList::RemoveItem怎么用?C++ BObjectList::RemoveItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BObjectList
的用法示例。
在下文中一共展示了BObjectList::RemoveItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MediaFilePlayer
void
PlayMediaFile(const char* media_type, const char* media_name)
{
entry_ref ref;
if (BMediaFiles().GetRefFor(media_type, media_name, &ref) != B_OK
|| !BEntry(&ref).Exists())
return;
MediaFilePlayer* player = list.EachElement(FindMediaFilePlayer,
(void*)media_name);
if (player != NULL) {
if (*(player->Ref()) == ref) {
player->Restart();
return;
}
list.RemoveItem(player);
delete player;
player = NULL;
}
if (player == NULL) {
player = new MediaFilePlayer(media_type, media_name, &ref);
if (player->InitCheck() == B_OK)
list.AddItem(player);
else
delete player;
}
}
示例2: _
/*! \brief Cleans up any memory allocated by the bitmap and
informs the server to do so as well (if needed).
*/
void
BBitmap::_CleanUp()
{
if (fWindow != NULL) {
if (fWindow->Lock())
delete fWindow;
fWindow = NULL;
// this will leak fWindow if it couldn't be locked
}
if (fBasePointer == NULL)
return;
if ((fFlags & B_BITMAP_NO_SERVER_LINK) != 0) {
free(fBasePointer);
} else if (fServerToken != -1) {
BPrivate::AppServerLink link;
// AS_DELETE_BITMAP:
// Attached Data:
// 1) int32 server token
link.StartMessage(AS_DELETE_BITMAP);
link.Attach<int32>(fServerToken);
link.Flush();
// The server areas are deleted via kMsgDeleteServerMemoryArea message
fArea = -1;
fServerToken = -1;
fAreaOffset = -1;
BAutolock _(sBitmapListLock);
sBitmapList.RemoveItem(this);
}
fBasePointer = NULL;
}
示例3:
// _PutAddOn
void
ModuleManager::_PutAddOn(ModuleAddOn *addon)
{
if (addon) {
if (addon->Put()) {
fAddOns.RemoveItem(addon);
delete addon;
}
}
}
示例4:
void
ExternalEventSource::RemoveListener(BaseJob* job)
{
fListeners.RemoveItem(job);
}
示例5:
void
RegisteredEvent::RemoveListener(BaseJob* job)
{
fListeners.RemoveItem(job);
}