[問題] 在不同thread new delete可以嗎?
我用BCB6
我在某個thread new char[256]
PostMessage給另一個thread
然後在另外一個thread delete[]該new出來的char pointer
請問這樣會有問題嗎?
表面上看起來應該OK
但是CodeGuard卻一直說Bad parameter, Function failure
還是compiler要家哪些設定或是參數呢?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 115.83.130.162
推
02/22 00:26, , 1F
02/22 00:26, 1F
→
02/22 00:27, , 2F
02/22 00:27, 2F
也許是BCB6 CodeGuard的問題吧
因為我試過在不同thread使用STL的insert/erase同一個set container
CodeGuard並沒有任何錯誤訊息
但是new/delete, malloc/free的確有Bad parameter的錯誤訊息
也許是假的錯誤訊息吧
※ 編輯: meltice 來自: 115.83.162.25 (02/22 16:15)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章