2
0
Эх сурвалжийг харах

pstats: Fix crash when frame has only level data and no time data

rdb 3 жил өмнө
parent
commit
759115fbc7

+ 3 - 3
panda/src/pstatclient/pStatFrameData.I

@@ -105,7 +105,7 @@ add_level(int index, double level) {
  */
 INLINE double PStatFrameData::
 get_start() const {
-  if (is_empty()) {
+  if (is_time_empty()) {
     return 0.0;
   }
 
@@ -118,7 +118,7 @@ get_start() const {
  */
 INLINE double PStatFrameData::
 get_end() const {
-  nassertr(!is_empty(), 0.0);
+  nassertr(!is_time_empty(), 0.0);
 
   return _time_data.back()._value;
 }
@@ -128,7 +128,7 @@ get_end() const {
  */
 INLINE double PStatFrameData::
 get_net_time() const {
-  nassertr(!is_empty(), 0.0);
+  nassertr(!is_time_empty(), 0.0);
 
   return _time_data.back()._value - _time_data.front()._value;
 }

+ 1 - 1
pandatool/src/pstatserver/pStatThreadData.cxx

@@ -267,7 +267,7 @@ record_new_frame(int frame_number, PStatFrameData *frame_data) {
   double oldest_allowable_time = time - _history;
   while (!_frames.empty() &&
          (_frames.front() == nullptr ||
-          _frames.front()->is_empty() ||
+          _frames.front()->is_time_empty() ||
           _frames.front()->get_start() < oldest_allowable_time)) {
     delete _frames.front();
     _frames.pop_front();