Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
bde52cc6
Unverified
Commit
bde52cc6
authored
Jan 02, 2020
by
Rémi Verschelde
Committed by
GitHub
Jan 02, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34618 from qarmin/vector_please_dont_crash
Don't use constant reference in Vector push_back, insert and append_array
parents
0dc26763
1ac701cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
vector.h
core/vector.h
+5
-5
editor_scene_importer_gltf.h
editor/import/editor_scene_importer_gltf.h
+3
-0
No files found.
core/vector.h
View file @
bde52cc6
...
...
@@ -63,7 +63,7 @@ private:
CowData
<
T
>
_cowdata
;
public
:
bool
push_back
(
const
T
&
p_elem
);
bool
push_back
(
T
p_elem
);
void
remove
(
int
p_index
)
{
_cowdata
.
remove
(
p_index
);
}
void
erase
(
const
T
&
p_val
)
{
...
...
@@ -83,10 +83,10 @@ public:
_FORCE_INLINE_
int
size
()
const
{
return
_cowdata
.
size
();
}
Error
resize
(
int
p_size
)
{
return
_cowdata
.
resize
(
p_size
);
}
_FORCE_INLINE_
const
T
&
operator
[](
int
p_index
)
const
{
return
_cowdata
.
get
(
p_index
);
}
Error
insert
(
int
p_pos
,
const
T
&
p_val
)
{
return
_cowdata
.
insert
(
p_pos
,
p_val
);
}
Error
insert
(
int
p_pos
,
T
p_val
)
{
return
_cowdata
.
insert
(
p_pos
,
p_val
);
}
int
find
(
const
T
&
p_val
,
int
p_from
=
0
)
const
{
return
_cowdata
.
find
(
p_val
,
p_from
);
}
void
append_array
(
const
Vector
<
T
>
&
p_other
);
void
append_array
(
Vector
<
T
>
p_other
);
template
<
class
C
>
void
sort_custom
()
{
...
...
@@ -136,7 +136,7 @@ void Vector<T>::invert() {
}
template
<
class
T
>
void
Vector
<
T
>::
append_array
(
const
Vector
<
T
>
&
p_other
)
{
void
Vector
<
T
>::
append_array
(
Vector
<
T
>
p_other
)
{
const
int
ds
=
p_other
.
size
();
if
(
ds
==
0
)
return
;
...
...
@@ -147,7 +147,7 @@ void Vector<T>::append_array(const Vector<T> &p_other) {
}
template
<
class
T
>
bool
Vector
<
T
>::
push_back
(
const
T
&
p_elem
)
{
bool
Vector
<
T
>::
push_back
(
T
p_elem
)
{
Error
err
=
resize
(
size
()
+
1
);
ERR_FAIL_COND_V
(
err
,
true
);
...
...
editor/import/editor_scene_importer_gltf.h
View file @
bde52cc6
...
...
@@ -172,7 +172,10 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
min
=
0
;
max
=
0
;
sparse_count
=
0
;
sparse_indices_buffer_view
=
0
;
sparse_indices_byte_offset
=
0
;
sparse_indices_component_type
=
0
;
sparse_values_buffer_view
=
0
;
sparse_values_byte_offset
=
0
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment