Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
worldg committed May 29, 2020
1 parent 7467e21 commit c0a4f10
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions kbe/src/lib/entitydef/entity_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,12 @@ bool EntityComponent::isSamePersistentType(PyObject* pyValue)
{
cellComponentPart = PyDict_GetItemString(cellDataDict, pPropertyDescription_->getName());
Py_DECREF(cellDataDict);
Py_INCREF(cellComponentPart);

// 组件没有cell属性时不会在cell创建这个组件
if (cellComponentPart)
{
Py_INCREF(cellComponentPart);
}
}
}

Expand Down Expand Up @@ -886,7 +891,12 @@ void EntityComponent::addPersistentToStream(MemoryStream* mstream, PyObject* pyV
{
cellComponentPart = PyDict_GetItemString(cellDataDict, pPropertyDescription_->getName());
Py_DECREF(cellDataDict);
Py_INCREF(cellComponentPart);

// 组件没有cell属性时不会在cell创建这个组件
if (cellComponentPart)
{
Py_INCREF(cellComponentPart);
}
}
}

Expand Down

0 comments on commit c0a4f10

Please sign in to comment.