Check if object pointer is null before commit
This commit is contained in:
parent
5daf1ce6c0
commit
c57ea608c3
5 changed files with 25 additions and 17 deletions
|
|
@ -153,10 +153,12 @@ void BrushTool::tool_update() {
|
|||
}
|
||||
|
||||
void BrushTool::commit_stroke() {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
if(objInfoBeingEdited) {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void BrushTool::gui_toolbox() {
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ void EditTool::switch_tool(DrawingProgramToolType newTool) {
|
|||
compEditTool->commit_edit_updates(objInfoBeingEdited, prevData);
|
||||
objInfoBeingEdited->obj->commit_update(drawP);
|
||||
objInfoBeingEdited->obj->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
}
|
||||
objInfoBeingEdited = nullptr;
|
||||
pointHandles.clear();
|
||||
pointDragging = nullptr;
|
||||
isEditing = false;
|
||||
|
|
|
|||
|
|
@ -97,10 +97,12 @@ bool EllipseDrawTool::prevent_undo_or_redo() {
|
|||
}
|
||||
|
||||
void EllipseDrawTool::commit() {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
if(objInfoBeingEdited) {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void EllipseDrawTool::draw(SkCanvas* canvas, const DrawData& drawData) {
|
||||
|
|
|
|||
|
|
@ -96,10 +96,12 @@ bool RectDrawTool::prevent_undo_or_redo() {
|
|||
}
|
||||
|
||||
void RectDrawTool::commit() {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
if(objInfoBeingEdited) {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void RectDrawTool::draw(SkCanvas* canvas, const DrawData& drawData) {
|
||||
|
|
|
|||
|
|
@ -96,10 +96,12 @@ bool TextBoxTool::prevent_undo_or_redo() {
|
|||
}
|
||||
|
||||
void TextBoxTool::commit() {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
if(objInfoBeingEdited) {
|
||||
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
|
||||
containerPtr->commit_update(drawP);
|
||||
containerPtr->send_comp_update(drawP, true);
|
||||
objInfoBeingEdited = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBoxTool::draw(SkCanvas* canvas, const DrawData& drawData) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue